Skip to content
Snippets Groups Projects
  1. Oct 03, 2024
  2. Aug 09, 2024
  3. Jul 17, 2024
  4. Jun 21, 2024
  5. May 23, 2024
    • Shuah Khan's avatar
      tools/latency-collector: Fix -Wformat-security compile warns · df73757c
      Shuah Khan authored
      Fix the following -Wformat-security compile warnings adding missing
      format arguments:
      
      latency-collector.c: In function ‘show_available’:
      latency-collector.c:938:17: warning: format not a string literal and
      no format arguments [-Wformat-security]
        938 |                 warnx(no_tracer_msg);
            |                 ^~~~~
      
      latency-collector.c:943:17: warning: format not a string literal and
      no format arguments [-Wformat-security]
        943 |                 warnx(no_latency_tr_msg);
            |                 ^~~~~
      
      latency-collector.c: In function ‘find_default_tracer’:
      latency-collector.c:986:25: warning: format not a string literal and
      no format arguments [-Wformat-security]
        986 |                         errx(EXIT_FAILURE, no_tracer_msg);
            |
                               ^~~~
      latency-collector.c: In function ‘scan_arguments’:
      latency-collector.c:1881:33: warning: format not a string literal and
      no format arguments [-Wformat-security]
       1881 |                                 errx(EXIT_FAILURE, no_tracer_msg);
            |                                 ^~~~
      
      Link: https://lore.kernel.org/linux-trace-kernel/20240404011009.32945-1-skhan@linuxfoundation.org
      
      
      
      Cc: stable@vger.kernel.org
      Fixes: e23db805 ("tracing/tools: Add the latency-collector to tools directory")
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      df73757c
  6. May 16, 2024
    • John Kacur's avatar
      rtla: Fix -t\--trace[=file] · 842fc5b8
      John Kacur authored
      The -t option has an optional argument.
      The usual case is for a short option to be specified without an '='
      and for the long version to be specified with an '='
      
      Various forms of this do not work as expected.
      For example:
      rtla timerlat hist -T50 -tfile.txt
      will result in a truncated file name of "ile.txt"
      
      Another example is that the long form without the '=' will result in the
      default file name instead of the requested file name.
      
      This patch properly parses the optional argument with and without '='
      and with and without spaces for the short form.
      
      This patch was also tested using -t and --trace without providing a file
      name both as the last requested option and with a following long and
      short option.
      
      For example:
      
        rtla timerlat hist -T50 -t -u
        rtla timerlat hist -T50 --trace -u
      
      This fix is applied to both timerlat top and hist
      and to osnoise top and hist.
      
      Here is the full testing for rtla timerlat hist.
      Before applying the patch
      
        rtla timerlat hist -T50 -t=file.txt
          Works as expected, "file.txt"
      
        rtla timerlat hist -T50 -tfile.txt
          Truncated file name "ile.txt"
      
        rtla timerlat hist -T50 -t file.txt
          Default file name instead of file.txt
      
        rtla timerlat hist -T50 --trace=file.txt
          Truncated file name "ile.txt"
      
        rtla timerlat hist -T50 --trace file.txt
          Default file name "timerlat_trace.txt" instead of "file.txt"
      
      After applying the patch:
      
        rtla timerlat hist -T50 -t=file.txt
          Works as expected, "file.txt"
      
        rtla timerlat hist -T50 -tfile.txt
          Works as expected, "file.txt"
      
        rtla timerlat hist -T50 -t file.txt
          Works as expected, "file.txt"
      
        rtla timerlat hist -T50 --trace=file.txt
          Works as expected, "file.txt"
      
        rtla timerlat hist -T50 --trace file.txt
          Works as expected, "file.txt"
      
      In addition the following tests were performed to make sure that
      the default file name worked as expected including with trailing
      options.
      
        rtla timerlat hist -T50 -t
          Works as expected "timerlat_trace.txt"
      
        rtla timerlat hist -T50 --trace
          Works as expected "timerlat_trace.txt"
      
        rtla timerlat hist -T50 -t -u
          Works as expected "timerlat_trace.txt"
      
        rtla timerlat hist -T50 --trace -u
          Works as expected "timerlat_trace.txt"
      
      Link: https://lkml.kernel.org/r/20240515183024.59985-1-jkacur@redhat.com
      
      
      
      Cc: Daniel Bristot de Oliveria <bristot@kernel.org>
      Signed-off-by: default avatarJohn Kacur <jkacur@redhat.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      842fc5b8
    • John Kacur's avatar
      rtla/timerlat: Fix histogram report when a cpu count is 0 · 01b05fc0
      John Kacur authored
      On short runs it is possible to get no samples on a cpu, like this:
      
        # rtla timerlat hist -u -T50
      
        Index   IRQ-001   Thr-001   Usr-001   IRQ-002   Thr-002   Usr-002
        2             1         0         0         0         0         0
        33            0         1         0         0         0         0
        36            0         0         1         0         0         0
        49            0         0         0         1         0         0
        52            0         0         0         0         1         0
        over:         0         0         0         0         0         0
        count:        1         1         1         1         1         0
        min:          2        33        36        49        52 18446744073709551615
        avg:          2        33        36        49        52         -
        max:          2        33        36        49        52         0
        rtla timerlat hit stop tracing
          IRQ handler delay:		(exit from idle)	    48.21 us (91.09 %)
          IRQ latency:						    49.11 us
          Timerlat IRQ duration:				     2.17 us (4.09 %)
          Blocking thread:					     1.01 us (1.90 %)
        	               swapper/2:0        		     1.01 us
        ------------------------------------------------------------------------
          Thread latency:					    52.93 us (100%)
      
        Max timerlat IRQ latency from idle: 49.11 us in cpu 2
      
      Note, the value 18446744073709551615 is the same as ~0.
      
      Fix this by reporting no results for the min, avg and max if the count
      is 0.
      
      Link: https://lkml.kernel.org/r/20240510190318.44295-1-jkacur@redhat.com
      
      
      
      Cc: stable@vger.kernel.org
      Fixes: 1eeb6328 ("rtla/timerlat: Add timerlat hist mode")
      Suggested-by: default avatarDaniel Bristot de Oliveria <bristot@kernel.org>
      Signed-off-by: default avatarJohn Kacur <jkacur@redhat.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      01b05fc0
    • Daniel Bristot de Oliveira's avatar
      rtla: Add --trace-buffer-size option · e9a4062e
      Daniel Bristot de Oliveira authored
      Add the option allow the users to set a different buffer size for the
      trace. For example, in large systems, the user might be interested on
      reducing the trace buffer to avoid large tracing files.
      
      The buffer size is specified in kB, and it is only affecting
      the tracing instance.
      
      The function trace_set_buffer_size() appears on libtracefs v1.6,
      so increase the minimum required version on Makefile.config.
      
      Link: https://lkml.kernel.org/r/e7c9ca5b3865f28e131a49ec3b984fadf2d056c6.1715860611.git.bristot@kernel.org
      
      
      
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Juri Lelli <juri.lelli@redhat.com>
      Cc: John Kacur <jkacur@redhat.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      e9a4062e
  7. May 15, 2024
  8. Mar 20, 2024
    • Daniel Bristot de Oliveira's avatar
      tools/rtla: Add -U/--user-load option to timerlat · a23c05fd
      Daniel Bristot de Oliveira authored
      The timerlat tracer provides an interface for any application to wait
      for the timerlat's periodic wakeup. Currently, rtla timerlat uses it
      to dispatch its user-space workload (-u option).
      
      But as the tracer interface is generic, rtla timerlat can also be used
      to monitor any workload that uses it. For example, a user might
      place their own workload to wait on the tracer interface, and
      monitor the results with rtla timerlat.
      
      Add the -U option to rtla timerlat top and hist. With this option, rtla
      timerlat will not dispatch its workload but only setting up the
      system, waiting for a user to dispatch its workload.
      
      The sample code in this patch is an example of python application
      that loops in the timerlat tracer fd.
      
      To use it, dispatch:
      
       # rtla timerlat -U
      
      In a terminal, then run the python program on another terminal,
      specifying the CPU to run it. For example, setting on CPU 1:
      
       #./timerlat_load.py 1
      
      Then rtla timerlat will start printing the statistics of the
      ./timerlat_load.py app.
      
      An interesting point is that the "Ret user Timer Latency" value
      is the overall response time of the load. The sample load does
      a memory copy to exemplify that.
      
      The stop tracing options on rtla timerlat works in this setup
      as well, including auto analysis.
      
      Link: https://lkml.kernel.org/r/36e6bcf18fe15c7601048fd4c65aeb193c502cc8.1707229706.git.bristot@kernel.org
      
      
      
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      a23c05fd
    • Daniel Bristot de Oliveira's avatar
      tools/rtla: Use tools/build makefiles to build rtla · 01474dc7
      Daniel Bristot de Oliveira authored
      Use tools/build/ makefiles to build rtla, inheriting the benefits of
      it. For example, having a proper way to handle dependencies.
      
      rtla is built using perf infra-structure when building inside the
      kernel tree.
      
      At this point, rtla diverges from perf in two points: Documentation
      and tarball generation/build.
      
      At the documentation level, rtla is one step ahead, placing the
      documentation at Documentation/tools/rtla/, using the same build
      tools as kernel documentation. The idea is to move perf
      documentation to the same scheme and then share the same makefiles.
      
      rtla has a tarball target that the (old) RHEL8 uses. The tarball was
      kept using a simple standalone makefile for compatibility. The
      standalone makefile shares most of the code, e.g., flags, with
      regular buildings.
      
      The tarball method was set as deprecated. If necessary, we can make
      a rtla tarball like perf, which includes the entire tools/build.
      But this would also require changes in the user side (the directory
      structure changes, and probably the deps to build the package).
      
      Inspired on perf and objtool.
      
      Link: https://lkml.kernel.org/r/57563abf2715d22515c0c54a87cff3849eca5d52.1710519524.git.bristot@kernel.org
      
      
      
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@kernel.org>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      01474dc7
    • Daniel Bristot de Oliveira's avatar
      tools/tracing: Use tools/build makefiles on latency-collector · 9d56c88e
      Daniel Bristot de Oliveira authored
      Use tools/build/ makefiles to build latency-collector, inheriting
      the benefits of it. For example: Before this patch, a missing
      tracefs/traceevents headers will result in fail like this:
      
        ~/linux/tools/tracing/latency $ make
        cc -Wall -Wextra -g -O2  -o latency-collector latency-collector.c -lpthread
        latency-collector.c:26:10: fatal error: tracefs.h: No such file or directory
           26 | #include <tracefs.h>
              |          ^~~~~~~~~~~
        compilation terminated.
        make: *** [Makefile:14: latency-collector] Error 1
      
      Which is not that helpful. After this change it reports:
      
        ~/linux/tools/tracing/latency# make
      
        Auto-detecting system features:
        ...                           libtraceevent: [ OFF ]
        ...                              libtracefs: [ OFF ]
      
        libtraceevent is missing. Please install libtraceevent-dev/libtraceevent-devel
        libtracefs is missing. Please install libtracefs-dev/libtracefs-devel
        Makefile.config:29: *** Please, check the errors above..  Stop.
      
      This type of output is common across other tools in tools/ like perf
      and objtool.
      
      Link: https://lkml.kernel.org/r/872420b0880b11304e4ba144a0086c6478c5b469.1710519524.git.bristot@kernel.org
      
      
      
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Josh Poimboeuf <jpoimboe@kernel.org>
      Cc: John Kacur <jkacur@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Jiri Olsa <jolsa@kernel.org>
      Suggested-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      9d56c88e
  9. Feb 12, 2024
    • John Kacur's avatar
      tools/rtla: Exit with EXIT_SUCCESS when help is invoked · b5f31936
      John Kacur authored
      Fix rtla so that the following commands exit with 0 when help is invoked
      
      rtla osnoise top -h
      rtla osnoise hist -h
      rtla timerlat top -h
      rtla timerlat hist -h
      
      Link: https://lore.kernel.org/linux-trace-devel/20240203001607.69703-1-jkacur@redhat.com
      
      
      
      Cc: stable@vger.kernel.org
      Fixes: 1eeb6328 ("rtla/timerlat: Add timerlat hist mode")
      Signed-off-by: default avatarJohn Kacur <jkacur@redhat.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      b5f31936
    • limingming3's avatar
      tools/rtla: Replace setting prio with nice for SCHED_OTHER · 14f08c97
      limingming3 authored
      Since the sched_priority for SCHED_OTHER is always 0, it makes no
      sence to set it.
      Setting nice for SCHED_OTHER seems more meaningful.
      
      Link: https://lkml.kernel.org/r/20240207065142.1753909-1-limingming3@lixiang.com
      
      
      
      Cc: stable@vger.kernel.org
      Fixes: b1696371 ("rtla: Helper functions for rtla")
      Signed-off-by: default avatarlimingming3 <limingming3@lixiang.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      14f08c97
    • Daniel Bristot de Oliveira's avatar
      tools/rtla: Remove unused sched_getattr() function · 084ce16d
      Daniel Bristot de Oliveira authored
      Clang is reporting:
      
      $ make HOSTCC=clang CC=clang LLVM_IAS=1
      [...]
      clang -O -g -DVERSION=\"6.8.0-rc3\" -flto=auto -fexceptions -fstack-protector-strong -fasynchronous-unwind-tables -fstack-clash-protection  -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS $(pkg-config --cflags libtracefs)    -c -o src/utils.o src/utils.c
      src/utils.c:241:19: warning: unused function 'sched_getattr' [-Wunused-function]
        241 | static inline int sched_getattr(pid_t pid, struct sched_attr *attr,
            |                   ^~~~~~~~~~~~~
      1 warning generated.
      
      Which is correct, so remove the unused function.
      
      Link: https://lkml.kernel.org/r/eaed7ba122c4ae88ce71277c824ef41cbf789385.1707217097.git.bristot@kernel.org
      
      
      
      Cc: stable@vger.kernel.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Bill Wendling <morbo@google.com>
      Cc: Justin Stitt <justinstitt@google.com>
      Cc: Donald Zickus <dzickus@redhat.com>
      Fixes: b1696371 ("rtla: Helper functions for rtla")
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      084ce16d
    • Daniel Bristot de Oliveira's avatar
      tools/rtla: Fix clang warning about mount_point var size · 30369084
      Daniel Bristot de Oliveira authored
      clang is reporting this warning:
      
      $ make HOSTCC=clang CC=clang LLVM_IAS=1
      [...]
      clang -O -g -DVERSION=\"6.8.0-rc3\" -flto=auto -fexceptions
      	-fstack-protector-strong -fasynchronous-unwind-tables
      	-fstack-clash-protection  -Wall -Werror=format-security
      	-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
      	$(pkg-config --cflags libtracefs)    -c -o src/utils.o src/utils.c
      
      src/utils.c:548:66: warning: 'fscanf' may overflow; destination buffer in argument 3 has size 1024, but the corresponding specifier may require size 1025 [-Wfortify-source]
        548 |         while (fscanf(fp, "%*s %" STR(MAX_PATH) "s %99s %*s %*d %*d\n", mount_point, type) == 2) {
            |                                                                         ^
      
      Increase mount_point variable size to MAX_PATH+1 to avoid the overflow.
      
      Link: https://lkml.kernel.org/r/1b46712e93a2f4153909514a36016959dcc4021c.1707217097.git.bristot@kernel.org
      
      
      
      Cc: stable@vger.kernel.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Bill Wendling <morbo@google.com>
      Cc: Justin Stitt <justinstitt@google.com>
      Cc: Donald Zickus <dzickus@redhat.com>
      Fixes: a957cbc0 ("rtla: Add -C cgroup support")
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      30369084
    • Daniel Bristot de Oliveira's avatar
      tools/rtla: Fix uninitialized bucket/data->bucket_size warning · 64dc40f7
      Daniel Bristot de Oliveira authored
      When compiling rtla with clang, I am getting the following warnings:
      
      $ make HOSTCC=clang CC=clang LLVM_IAS=1
      
      [..]
      clang -O -g -DVERSION=\"6.8.0-rc3\" -flto=auto -fexceptions
      	-fstack-protector-strong -fasynchronous-unwind-tables
      	-fstack-clash-protection  -Wall -Werror=format-security
      	-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
      	$(pkg-config --cflags libtracefs)
      	-c -o src/osnoise_hist.o src/osnoise_hist.c
      src/osnoise_hist.c:138:6: warning: variable 'bucket' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        138 |         if (data->bucket_size)
            |             ^~~~~~~~~~~~~~~~~
      src/osnoise_hist.c:149:6: note: uninitialized use occurs here
        149 |         if (bucket < entries)
            |             ^~~~~~
      src/osnoise_hist.c:138:2: note: remove the 'if' if its condition is always true
        138 |         if (data->bucket_size)
            |         ^~~~~~~~~~~~~~~~~~~~~~
        139 |                 bucket = duration / data->bucket_size;
      src/osnoise_hist.c:132:12: note: initialize the variable 'bucket' to silence this warning
        132 |         int bucket;
            |                   ^
            |                    = 0
      1 warning generated.
      
      [...]
      
      clang -O -g -DVERSION=\"6.8.0-rc3\" -flto=auto -fexceptions
      	-fstack-protector-strong -fasynchronous-unwind-tables
      	-fstack-clash-protection  -Wall -Werror=format-security
      	-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS
      	$(pkg-config --cflags libtracefs)
      	-c -o src/timerlat_hist.o src/timerlat_hist.c
      src/timerlat_hist.c:181:6: warning: variable 'bucket' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        181 |         if (data->bucket_size)
            |             ^~~~~~~~~~~~~~~~~
      src/timerlat_hist.c:204:6: note: uninitialized use occurs here
        204 |         if (bucket < entries)
            |             ^~~~~~
      src/timerlat_hist.c:181:2: note: remove the 'if' if its condition is always true
        181 |         if (data->bucket_size)
            |         ^~~~~~~~~~~~~~~~~~~~~~
        182 |                 bucket = latency / data->bucket_size;
      src/timerlat_hist.c:175:12: note: initialize the variable 'bucket' to silence this warning
        175 |         int bucket;
            |                   ^
            |                    = 0
      1 warning generated.
      
      This is a legit warning, but data->bucket_size is always > 0 (see
      timerlat_hist_parse_args()), so the if is not necessary.
      
      Remove the unneeded if (data->bucket_size) to avoid the warning.
      
      Link: https://lkml.kernel.org/r/6e1b1665cd99042ae705b3e0fc410858c4c42346.1707217097.git.bristot@kernel.org
      
      
      
      Cc: stable@vger.kernel.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Bill Wendling <morbo@google.com>
      Cc: Justin Stitt <justinstitt@google.com>
      Cc: Donald Zickus <dzickus@redhat.com>
      Fixes: 1eeb6328 ("rtla/timerlat: Add timerlat hist mode")
      Fixes: 829a6c0b ("rtla/osnoise: Add the hist mode")
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      64dc40f7
    • Daniel Bristot de Oliveira's avatar
      tools/rtla: Fix Makefile compiler options for clang · bc4cbc9d
      Daniel Bristot de Oliveira authored
      The following errors are showing up when compiling rtla with clang:
      
       $ make HOSTCC=clang CC=clang LLVM_IAS=1
       [...]
      
        clang -O -g -DVERSION=\"6.8.0-rc1\" -flto=auto -ffat-lto-objects
      	-fexceptions -fstack-protector-strong
      	-fasynchronous-unwind-tables -fstack-clash-protection  -Wall
      	-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
      	-Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized
      	$(pkg-config --cflags libtracefs)    -c -o src/utils.o src/utils.c
      
        clang: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
        warning: unknown warning option '-Wno-maybe-uninitialized'; did you mean '-Wno-uninitialized'? [-Wunknown-warning-option]
        1 warning generated.
      
        clang -o rtla -ggdb  src/osnoise.o src/osnoise_hist.o src/osnoise_top.o
        src/rtla.o src/timerlat_aa.o src/timerlat.o src/timerlat_hist.o
        src/timerlat_top.o src/timerlat_u.o src/trace.o src/utils.o $(pkg-config --libs libtracefs)
      
        src/osnoise.o: file not recognized: file format not recognized
        clang: error: linker command failed with exit code 1 (use -v to see invocation)
        make: *** [Makefile:110: rtla] Error 1
      
      Solve these issues by:
        - removing -ffat-lto-objects and -Wno-maybe-uninitialized if using clang
        - informing the linker about -flto=auto
      
      Link: https://lore.kernel.org/linux-trace-kernel/567ac1b94effc228ce9a0225b9df7232a9b35b55.1707217097.git.bristot@kernel.org
      
      
      
      Cc: stable@vger.kernel.org
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Nathan Chancellor <nathan@kernel.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Bill Wendling <morbo@google.com>
      Cc: Justin Stitt <justinstitt@google.com>
      Fixes: 1a7b22ab ("tools/rtla: Build with EXTRA_{C,LD}FLAGS")
      Suggested-by: default avatarDonald Zickus <dzickus@redhat.com>
      Signed-off-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      bc4cbc9d
  10. Oct 30, 2023
  11. Sep 22, 2023
  12. Sep 12, 2023
  13. Jun 13, 2023
Loading