]> Git Repo - linux.git/blobdiff - tools/perf/util/scripting-engines/trace-event-python.c
scsi: zfcp: Trace when request remove fails after qdio send fails
[linux.git] / tools / perf / util / scripting-engines / trace-event-python.c
index 0f229fa29163eacd2719777e863a87891954eeae..e930f5f1f36d2831860d142143e4fc802bc3e46d 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/bitmap.h>
 #include <linux/compiler.h>
 #include <linux/time64.h>
+#include <traceevent/event-parse.h>
 
 #include "../build-id.h"
 #include "../counts.h"
@@ -52,6 +53,7 @@
 #include "print_binary.h"
 #include "stat.h"
 #include "mem-events.h"
+#include "util/perf_regs.h"
 
 #if PY_MAJOR_VERSION < 3
 #define _PyUnicode_FromString(arg) \
@@ -992,8 +994,10 @@ static void python_process_tracepoint(struct perf_sample *sample,
                                offset  = val;
                                len     = offset >> 16;
                                offset &= 0xffff;
+#ifdef HAVE_LIBTRACEEVENT_TEP_FIELD_IS_RELATIVE
                                if (field->flags & TEP_FIELD_IS_RELATIVE)
                                        offset += field->offset + field->size;
+#endif
                        }
                        if (field->flags & TEP_FIELD_IS_STRING &&
                            is_printable_array(data + offset, len)) {
@@ -1653,13 +1657,7 @@ static void python_process_stat(struct perf_stat_config *config,
        struct perf_cpu_map *cpus = counter->core.cpus;
        int cpu, thread;
 
-       if (config->aggr_mode == AGGR_GLOBAL) {
-               process_stat(counter, (struct perf_cpu){ .cpu = -1 }, -1, tstamp,
-                            &counter->counts->aggr);
-               return;
-       }
-
-       for (thread = 0; thread < threads->nr; thread++) {
+       for (thread = 0; thread < perf_thread_map__nr(threads); thread++) {
                for (cpu = 0; cpu < perf_cpu_map__nr(cpus); cpu++) {
                        process_stat(counter, perf_cpu_map__cpu(cpus, cpu),
                                     perf_thread_map__pid(threads, thread), tstamp,
This page took 0.03411 seconds and 4 git commands to generate.