]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
misc: tegra-profiler: add thumb flag into samples
authorIgor Nabirushkin <inabirushkin@nvidia.com>
Tue, 24 Sep 2013 13:34:09 +0000 (17:34 +0400)
committerBharat Nihalani <bnihalani@nvidia.com>
Thu, 31 Oct 2013 10:27:16 +0000 (03:27 -0700)
Tegra Profiler misc driver: thumb mode flag was
added into samples

Bug 1374335

Change-Id: Ie80e6508ed2a35b73ca5e65fd31d41f99220a252
Signed-off-by: Igor Nabirushkin <inabirushkin@nvidia.com>
Reviewed-on: http://git-master/r/298731
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Daniel Horowitz <dhorowitz@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Maxim Morin <mmorin@nvidia.com>
drivers/misc/tegra-profiler/debug.c
drivers/misc/tegra-profiler/hrt.c
drivers/misc/tegra-profiler/tegra.h
drivers/misc/tegra-profiler/version.h
include/linux/tegra_profiler.h

index e0270a310ae4cdf8ed32f1854a95f3f5fba20cef..fbe95b52f4732f747e8497d527e91a19dcfacf41 100644 (file)
@@ -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;
index f0a8b277b5f7b68143820721a53f6dc9affcc98c..0066f3af55204c3832ce00ed1334adf73c98c724 100644 (file)
@@ -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) {
index 013c5abd644fba43a61b2911cc65e2c29a817682..65cd6cd0e142f78585aca5d0cf76216876499239 100644 (file)
 #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;
 }
 
index 91fade52fa575683b8860e50f7e585db230209da..6b0f795bb60c4f33596602b0743f6d1c0c308405 100644 (file)
@@ -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 */
index 2efa9c185e6cdd6c487bf163dd2ac4e4609c7703..823b05e5a6f85dd418ad19177bc34cb16085d8e8 100644 (file)
 
 #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,