summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Nabirushkin <inabirushkin@nvidia.com>2013-09-08 10:43:36 +0400
committerHarry Hong <hhong@nvidia.com>2013-12-10 16:20:56 -0800
commit2db9a3c8f9089046a4c08215d404f2770aae847a (patch)
treeb2040eba8cf843a41a71b04dcb3231aa3c549b12
parent3ff4584ba4722df6a3f1802ac86c461e556f3516 (diff)
misc: tegra-profiler: remove excess callchains
Tegra Profiler: improve performance by removing unnecessary callchains Bug 1364258 Change-Id: I664fbabb576b98b1609db6fd904d9449727e2523 Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com> Reviewed-on: http://git-master/r/277090 (cherry picked from commit 65da0a2e6e2b984326c4f75775ba58cb38949956) Reviewed-on: http://git-master/r/340002 Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com>
-rw-r--r--drivers/misc/tegra-profiler/hrt.c21
-rw-r--r--drivers/misc/tegra-profiler/version.h2
2 files changed, 13 insertions, 10 deletions
diff --git a/drivers/misc/tegra-profiler/hrt.c b/drivers/misc/tegra-profiler/hrt.c
index 6a9c39ffd05c..fdfbb96f5910 100644
--- a/drivers/misc/tegra-profiler/hrt.c
+++ b/drivers/misc/tegra-profiler/hrt.c
@@ -253,6 +253,9 @@ static void read_source(struct quadd_event_source_interface *source,
return;
}
+ if (atomic_read(&cpu_ctx->nr_active) == 0)
+ return;
+
if (user_mode(regs) && hrt.quadd_ctx->param.backtrace) {
callchain_nr = quadd_get_user_callchain(regs, callchain_data);
if (callchain_nr > 0) {
@@ -275,20 +278,20 @@ static void read_source(struct quadd_event_source_interface *source,
!quadd_ctx->collect_kernel_ips)
record_data.sample.ip = 0;
- record_data.sample.callchain_nr = callchain_nr;
-
if (pid > 0) {
record_data.sample.pid = pid;
- quadd_put_sample(&record_data, extra_data,
- extra_length);
} else {
t_data = &cpu_ctx->active_thread;
+ record_data.sample.pid = t_data->pid;
+ }
- if (atomic_read(&cpu_ctx->nr_active) > 0) {
- record_data.sample.pid = t_data->pid;
- quadd_put_sample(&record_data, extra_data,
- extra_length);
- }
+ if (i == 0) {
+ record_data.sample.callchain_nr = callchain_nr;
+ quadd_put_sample(&record_data, extra_data,
+ extra_length);
+ } else {
+ record_data.sample.callchain_nr = 0;
+ quadd_put_sample(&record_data, NULL, 0);
}
}
}
diff --git a/drivers/misc/tegra-profiler/version.h b/drivers/misc/tegra-profiler/version.h
index 838c1f4d56f4..3c03b2978711 100644
--- a/drivers/misc/tegra-profiler/version.h
+++ b/drivers/misc/tegra-profiler/version.h
@@ -18,7 +18,7 @@
#ifndef __QUADD_VERSION_H
#define __QUADD_VERSION_H
-#define QUADD_MODULE_VERSION "1.29"
+#define QUADD_MODULE_VERSION "1.30"
#define QUADD_MODULE_BRANCH "Dev"
#endif /* __QUADD_VERSION_H */