]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - tools/perf/util/auxtrace.c
Merge remote-tracking branches 'regulator/fix/88pm800', 'regulator/fix/max8973',...
[karo-tx-linux.git] / tools / perf / util / auxtrace.c
index df66966cfde7ab1e78f9f5da6610ad8d707dea9c..83d9dd96fe08ea8c613d1bda4db9b00bf4d04cd9 100644 (file)
@@ -53,11 +53,6 @@ int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
 {
        struct perf_event_mmap_page *pc = userpg;
 
-#if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
-       pr_err("Cannot use AUX area tracing mmaps\n");
-       return -1;
-#endif
-
        WARN_ONCE(mm->base, "Uninitialized auxtrace_mmap\n");
 
        mm->userpg = userpg;
@@ -73,6 +68,11 @@ int auxtrace_mmap__mmap(struct auxtrace_mmap *mm,
                return 0;
        }
 
+#if BITS_PER_LONG != 64 && !defined(HAVE_SYNC_COMPARE_AND_SWAP_SUPPORT)
+       pr_err("Cannot use AUX area tracing mmaps\n");
+       return -1;
+#endif
+
        pc->aux_offset = mp->offset;
        pc->aux_size = mp->len;
 
@@ -119,12 +119,12 @@ void auxtrace_mmap_params__set_idx(struct auxtrace_mmap_params *mp,
        if (per_cpu) {
                mp->cpu = evlist->cpus->map[idx];
                if (evlist->threads)
-                       mp->tid = evlist->threads->map[0];
+                       mp->tid = thread_map__pid(evlist->threads, 0);
                else
                        mp->tid = -1;
        } else {
                mp->cpu = -1;
-               mp->tid = evlist->threads->map[idx];
+               mp->tid = thread_map__pid(evlist->threads, idx);
        }
 }
 
@@ -1182,6 +1182,13 @@ static int __auxtrace_mmap__read(struct auxtrace_mmap *mm,
                data2 = NULL;
        }
 
+       if (itr->alignment) {
+               unsigned int unwanted = len1 % itr->alignment;
+
+               len1 -= unwanted;
+               size -= unwanted;
+       }
+
        /* padding must be written by fn() e.g. record__process_auxtrace() */
        padding = size & 7;
        if (padding)