summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Nabirushkin <inabirushkin@nvidia.com>2013-09-24 17:34:09 +0400
committerHarry Hong <hhong@nvidia.com>2013-12-10 16:22:05 -0800
commit1e5922b8fb4bfe1a766391fdf9a9803b0dd68827 (patch)
tree8777b703d3622218be54c017f14c5cbcfea87496
parentc593b1898f2bb6b5dac3e9cccafebad2c97c9f85 (diff)
misc: tegra-profiler: add thumb flag into samples
Tegra Profiler misc driver: thumb mode flag was added into samples Bug 1374335 Change-Id: If1a6b7e57071f6c9d645bc790e24cd1e3e405b6f Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com> Reviewed-on: http://git-master/r/324082 (cherry picked from commit 293d786bcb5211333e269f61d8d23e286ee3c28b) Reviewed-on: http://git-master/r/340012 Reviewed-by: Harry Hong <hhong@nvidia.com> Tested-by: Harry Hong <hhong@nvidia.com>
-rw-r--r--drivers/misc/tegra-profiler/debug.c2
-rw-r--r--drivers/misc/tegra-profiler/hrt.c7
-rw-r--r--drivers/misc/tegra-profiler/tegra.h8
-rw-r--r--drivers/misc/tegra-profiler/version.h2
-rw-r--r--include/linux/tegra_profiler.h7
5 files changed, 16 insertions, 10 deletions
diff --git a/drivers/misc/tegra-profiler/debug.c b/drivers/misc/tegra-profiler/debug.c
index e0270a310ae4..fbe95b52f473 100644
--- a/drivers/misc/tegra-profiler/debug.c
+++ b/drivers/misc/tegra-profiler/debug.c
@@ -42,7 +42,7 @@ init_sample(struct quadd_record_data *record, struct pt_regs *regs)
record->cpu_mode = user_mode(regs) ?
QUADD_CPU_MODE_USER : QUADD_CPU_MODE_KERNEL;
- s->cpu = quadd_get_processor_id();
+ s->cpu = quadd_get_processor_id(regs);
s->pid = 0;
s->time = quadd_get_time();
s->timer_period = 0;
diff --git a/drivers/misc/tegra-profiler/hrt.c b/drivers/misc/tegra-profiler/hrt.c
index f0a8b277b5f7..0066f3af5520 100644
--- a/drivers/misc/tegra-profiler/hrt.c
+++ b/drivers/misc/tegra-profiler/hrt.c
@@ -203,7 +203,7 @@ static int get_sample_data(struct event_data *event,
sample->event_id = event->event_id;
sample->ip = instruction_pointer(regs);
- sample->cpu = quadd_get_processor_id();
+ sample->cpu = quadd_get_processor_id(regs);
sample->time = get_sample_time();
if (prev_val <= val)
@@ -388,7 +388,7 @@ void __quadd_task_sched_in(struct task_struct *prev,
/*
if (__ratelimit(&ratelimit_state))
pr_info("sch_in, cpu: %d, prev: %u (%u) \t--> curr: %u (%u)\n",
- quadd_get_processor_id(), (unsigned int)prev->pid,
+ smp_processor_id(), (unsigned int)prev->pid,
(unsigned int)prev->tgid, (unsigned int)task->pid,
(unsigned int)task->tgid);
*/
@@ -424,11 +424,10 @@ void __quadd_task_sched_out(struct task_struct *prev,
/*
if (__ratelimit(&ratelimit_state))
pr_info("sch_out: cpu: %d, prev: %u (%u) \t--> next: %u (%u)\n",
- quadd_get_processor_id(), (unsigned int)prev->pid,
+ smp_processor_id(), (unsigned int)prev->pid,
(unsigned int)prev->tgid, (unsigned int)next->pid,
(unsigned int)next->tgid);
*/
-
prev_flag = is_profile_process(prev->tgid);
if (prev_flag) {
diff --git a/drivers/misc/tegra-profiler/tegra.h b/drivers/misc/tegra-profiler/tegra.h
index 013c5abd644f..65cd6cd0e142 100644
--- a/drivers/misc/tegra-profiler/tegra.h
+++ b/drivers/misc/tegra-profiler/tegra.h
@@ -18,21 +18,25 @@
#define __QUADD_TEGRA_H
#include <linux/smp.h>
+#include <asm/ptrace.h>
#ifdef CONFIG_TEGRA_CLUSTER_CONTROL
#include <linux/io.h>
#include <../../mach-tegra/pm.h>
#endif
-static inline int quadd_get_processor_id(void)
+static inline int quadd_get_processor_id(struct pt_regs *regs)
{
int cpu_id = smp_processor_id();
#ifdef CONFIG_TEGRA_CLUSTER_CONTROL
if (is_lp_cluster())
- cpu_id |= QM_TEGRA_POWER_CLUSTER_LP;
+ cpu_id |= QUADD_CPUMODE_TEGRA_POWER_CLUSTER_LP;
#endif
+ if (thumb_mode(regs))
+ cpu_id |= QUADD_CPUMODE_THUMB;
+
return cpu_id;
}
diff --git a/drivers/misc/tegra-profiler/version.h b/drivers/misc/tegra-profiler/version.h
index 91fade52fa57..6b0f795bb60c 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.33"
+#define QUADD_MODULE_VERSION "1.34"
#define QUADD_MODULE_BRANCH "Dev"
#endif /* __QUADD_VERSION_H */
diff --git a/include/linux/tegra_profiler.h b/include/linux/tegra_profiler.h
index 2efa9c185e6c..823b05e5a6f8 100644
--- a/include/linux/tegra_profiler.h
+++ b/include/linux/tegra_profiler.h
@@ -19,12 +19,14 @@
#include <linux/ioctl.h>
-#define QUADD_SAMPLES_VERSION 16
+#define QUADD_SAMPLES_VERSION 17
#define QUADD_IO_VERSION 6
#define QUADD_IO_VERSION_DYNAMIC_RB 5
#define QUADD_IO_VERSION_RB_MAX_FILL_COUNT 6
+#define QUADD_SAMPLE_VERSION_THUMB_MODE_FLAG 17
+
#define QUADD_MAX_COUNTERS 32
#define QUADD_MAX_PROCESS 64
@@ -66,7 +68,8 @@
#define QUADD_HRT_SCHED_IN_FUNC "finish_task_switch"
-#define QM_TEGRA_POWER_CLUSTER_LP (1 << 29) /* LP CPU */
+#define QUADD_CPUMODE_TEGRA_POWER_CLUSTER_LP (1 << 29) /* LP CPU */
+#define QUADD_CPUMODE_THUMB (1 << 30) /* thumb mode */
enum quadd_events_id {
QUADD_EVENT_TYPE_CPU_CYCLES = 0,