/*
* drivers/misc/tegra-profiler/hrt.c
*
- * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
s->sched_in = is_sched_in ? 1 : 0;
s->time = quadd_get_time();
s->pid = task->pid;
+ s->tgid = task->tgid;
s->reserved = 0;
sample->time = quadd_get_time();
sample->reserved = 0;
sample->pid = task->pid;
+ sample->tgid = task->tgid;
sample->in_interrupt = in_interrupt() ? 1 : 0;
return 0;
}
static inline int
-is_profile_process(struct task_struct *task)
+is_sample_process(struct task_struct *task)
{
int i;
pid_t pid, profile_pid;
return 0;
}
+static inline int
+is_swapper_task(struct task_struct *task)
+{
+ if (task->pid == 0)
+ return 1;
+
+ return 0;
+}
+
+static inline int
+is_trace_process(struct task_struct *task)
+{
+ struct quadd_ctx *ctx = hrt.quadd_ctx;
+
+ if (!task)
+ return 0;
+
+ if (is_swapper_task(task))
+ return 0;
+
+ if (ctx->param.trace_all_tasks)
+ return 1;
+
+ return is_sample_process(task);
+}
+
static int
add_active_thread(struct quadd_cpu_context *cpu_ctx, pid_t pid, pid_t tgid)
{
(unsigned int)task->tgid);
*/
- if (is_profile_process(task)) {
+ if (is_trace_process(task))
put_sched_sample(task, 1);
+ if (is_sample_process(task)) {
add_active_thread(cpu_ctx, task->pid, task->tgid);
atomic_inc(&cpu_ctx->nr_active);
(unsigned int)next->tgid);
*/
- if (is_profile_process(prev)) {
+ if (is_sample_process(prev)) {
user_regs = task_pt_regs(prev);
if (user_regs)
read_all_sources(user_regs, prev);
if (ctx->pmu)
ctx->pmu->stop();
}
+ }
+ if (is_trace_process(prev))
put_sched_sample(prev, 0);
- }
}
void __quadd_event_mmap(struct vm_area_struct *vma)
if (likely(!atomic_read(&hrt.active)))
return;
- if (!is_profile_process(current))
+ if (!is_sample_process(current))
return;
param = &hrt.quadd_ctx->param;
/*
* drivers/misc/tegra-profiler/hrt.h
*
- * Copyright (c) 2013-2015, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013-2016, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
#ifndef __QUADD_VERSION_H
#define __QUADD_VERSION_H
-#define QUADD_MODULE_VERSION "1.105"
+#define QUADD_MODULE_VERSION "1.107"
#define QUADD_MODULE_BRANCH "Dev"
#endif /* __QUADD_VERSION_H */
/*
* include/linux/tegra_profiler.h
*
- * Copyright (c) 2013-2015, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2013-2016, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
#include <linux/ioctl.h>
-#define QUADD_SAMPLES_VERSION 35
-#define QUADD_IO_VERSION 19
+#define QUADD_SAMPLES_VERSION 36
+#define QUADD_IO_VERSION 20
#define QUADD_IO_VERSION_DYNAMIC_RB 5
#define QUADD_IO_VERSION_RB_MAX_FILL_COUNT 6
#define QUADD_IO_VERSION_SECTIONS_INFO 17
#define QUADD_IO_VERSION_UNW_METHODS_OPT 18
#define QUADD_IO_VERSION_PER_CPU_SETUP 19
+#define QUADD_IO_VERSION_TRACE_ALL_TASKS 20
#define QUADD_SAMPLE_VERSION_THUMB_MODE_FLAG 17
#define QUADD_SAMPLE_VERSION_GROUP_SAMPLES 18
#define QUADD_SAMPLE_VERSION_URCS 33
#define QUADD_SAMPLE_VERSION_HOTPLUG 34
#define QUADD_SAMPLE_VERSION_PER_CPU_SETUP 35
+#define QUADD_SAMPLE_VERSION_REPORT_TGID 36
#define QUADD_MMAP_HEADER_VERSION 1
struct quadd_sample_data {
u64 ip;
u32 pid;
+ u32 tgid;
u64 time;
u16 cpu:6,
struct quadd_sched_data {
u32 pid;
+ u32 tgid;
u64 time;
u32 cpu:6,
u64 backtrace:1,
use_freq:1,
system_wide:1,
- debug_samples:1;
+ debug_samples:1,
+ trace_all_tasks:1;
u32 pids[QUADD_MAX_PROCESS];
u32 nr_pids;