misc: tegra-profiler: fix lost samples
Igor Nabirushkin [Mon, 10 Jul 2017 19:54:12 +0000 (23:54 +0400)]
Do not send 'header' samples for non-present cores.
This fixes lost samples in some cases.

Bug 1956713

Change-Id: Ib09aecbb71265b96840e18dcb40315adf286994f
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1516355
(cherry picked from commit 333e27f016348a41473292189be72ad05512c528)

drivers/misc/tegra-profiler/hrt.c

index eb88636..edde3e1 100644 (file)
@@ -729,8 +729,10 @@ int quadd_hrt_start(void)
        hrt.get_stack_offset =
                (extra & QUADD_PARAM_EXTRA_STACK_OFFSET) ? 1 : 0;
 
-       for_each_possible_cpu(cpuid)
-               put_header(cpuid);
+       for_each_possible_cpu(cpuid) {
+               if (ctx->pmu->get_arch(cpuid))
+                       put_header(cpuid);
+       }
 
        if (extra & QUADD_PARAM_EXTRA_GET_MMAP) {
                err = quadd_get_current_mmap(param->pids[0]);