Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1407242 > unrolled thread
| Started by | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| First post | 2016-05-25 23:40 +0200 |
| Last post | 2016-05-25 23:40 +0200 |
| Articles | 2 — 1 participant |
Back to article view | Back to linux.kernel
[GIT PULL 00/10] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-05-25 23:40 +0200
[PATCH 03/10] perf thread: Adopt get_main_thread from db-export.c Arnaldo Carvalho de Melo <acme@kernel.org> - 2016-05-25 23:40 +0200
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-05-25 23:40 +0200 |
| Subject | [GIT PULL 00/10] perf/core improvements and fixes |
| Message-ID | <rCOGZ-5ZT-7@gated-at.bofh.it> |
Hi Ingo,
Please consider pulling,
- Arnaldo
The following changes since commit 275ae411e56f8f900fa364da29c4706f9af4e1f3:
perf/x86/intel/rapl: Fix pmus free during cleanup (2016-05-25 10:56:43 +0200)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux.git tags/perf-core-for-mingo-20160525
for you to fetch changes up to 83e1e314baf9a1424bf2f50953ed7d50612763c4:
tools: Pass arg to fdarray__filter's call back function (2016-05-25 17:27:25 -0300)
----------------------------------------------------------------
perf/core improvements and fixes:
User visible/kernel ABI:
- Per event callchain limit: Recently we introduced a sysctl to tune the
max-stack for all events for which callchains were requested:
$ sysctl kernel.perf_event_max_stack
kernel.perf_event_max_stack = 127
Now this patch introduces a way to configure this per event, i.e. this
becomes possible:
$ perf record -e sched:*/max-stack=2/ -e block:*/max-stack=10/ -a
allowing finer tuning of how much buffer space callchains use.
This uses an u16 from the reserved space at the end, leaving another
u16 for future use.
There has been interest in even finer tuning, namely to control the
max stack for kernel and userspace callchains separately. Further
discussion is needed, we may for instance use the remaining u16 for
that and when it is present, assume that the sample_max_stack introduced
in this patch applies for the kernel, and the u16 left is used for
limiting the userspace callchain. (Arnaldo Carvalho de Melo)
- Fix kptr_restrict=2 related 'perf record' segfault (Wang Nan)
Infrastructure;
- Adopt get_main_thread from db-export.c (Andi Kleen)
- More prep work for backward ring buffer support (Wang Nan)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
----------------------------------------------------------------
Andi Kleen (1):
perf thread: Adopt get_main_thread from db-export.c
Arnaldo Carvalho de Melo (2):
perf core: Per event callchain limit
perf tools: Per event max-stack settings
Wang Nan (7):
perf symbols: Check kptr_restrict for root
perf record: Fix crash when kptr is restricted
perf record: Robustify perf_event__synth_time_conv()
perf evlist: Don't poll and mmap overwritable events
perf evlist: Check 'base' pointer before checking refcnt when put a mmap
perf evlist: Choose correct reading direction according to evlist->backward
tools: Pass arg to fdarray__filter's call back function
include/linux/perf_event.h | 2 +-
include/uapi/linux/perf_event.h | 6 +++++-
kernel/bpf/stackmap.c | 2 +-
kernel/events/callchain.c | 14 ++++++++++++--
kernel/events/core.c | 5 ++++-
tools/lib/api/fd/array.c | 5 +++--
tools/lib/api/fd/array.h | 3 ++-
tools/perf/arch/x86/util/tsc.c | 2 ++
tools/perf/builtin-record.c | 9 ++++++++-
tools/perf/tests/fdarray.c | 8 ++++----
tools/perf/util/callchain.h | 1 +
tools/perf/util/db-export.c | 13 +------------
tools/perf/util/event.c | 2 ++
tools/perf/util/evlist.c | 43 ++++++++++++++++++++++++++++++++---------
tools/perf/util/evlist.h | 2 ++
tools/perf/util/evsel.c | 16 +++++++++++++--
tools/perf/util/evsel.h | 2 ++
tools/perf/util/parse-events.c | 8 ++++++++
tools/perf/util/parse-events.h | 1 +
tools/perf/util/parse-events.l | 1 +
tools/perf/util/session.c | 2 ++
tools/perf/util/symbol.c | 16 +++++++--------
tools/perf/util/thread.c | 11 +++++++++++
tools/perf/util/thread.h | 2 ++
24 files changed, 131 insertions(+), 45 deletions(-)
[toc] | [next] | [standalone]
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Date | 2016-05-25 23:40 +0200 |
| Subject | [PATCH 03/10] perf thread: Adopt get_main_thread from db-export.c |
| Message-ID | <rCOH0-5ZT-33@gated-at.bofh.it> |
| In reply to | #1407242 |
From: Andi Kleen <ak@linux.intel.com>
Move the get_main_thread function from db-export.c to thread.c so that
it can be used elsewhere.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/1464051145-19968-2-git-send-email-andi@firstfloor.org
[ Removed leftover bits from db-export.h ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/db-export.c | 13 +------------
tools/perf/util/thread.c | 11 +++++++++++
tools/perf/util/thread.h | 2 ++
3 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/tools/perf/util/db-export.c b/tools/perf/util/db-export.c
index c9a6dc173e74..b0c2b5c5d337 100644
--- a/tools/perf/util/db-export.c
+++ b/tools/perf/util/db-export.c
@@ -233,17 +233,6 @@ int db_export__symbol(struct db_export *dbe, struct symbol *sym,
return 0;
}
-static struct thread *get_main_thread(struct machine *machine, struct thread *thread)
-{
- if (thread->pid_ == thread->tid)
- return thread__get(thread);
-
- if (thread->pid_ == -1)
- return NULL;
-
- return machine__find_thread(machine, thread->pid_, thread->pid_);
-}
-
static int db_ids_from_al(struct db_export *dbe, struct addr_location *al,
u64 *dso_db_id, u64 *sym_db_id, u64 *offset)
{
@@ -382,7 +371,7 @@ int db_export__sample(struct db_export *dbe, union perf_event *event,
if (err)
return err;
- main_thread = get_main_thread(al->machine, thread);
+ main_thread = thread__main_thread(al->machine, thread);
if (main_thread)
comm = machine__thread_exec_comm(al->machine, main_thread);
diff --git a/tools/perf/util/thread.c b/tools/perf/util/thread.c
index 45fcb715a36b..ada58e6070bf 100644
--- a/tools/perf/util/thread.c
+++ b/tools/perf/util/thread.c
@@ -265,3 +265,14 @@ void thread__find_cpumode_addr_location(struct thread *thread,
break;
}
}
+
+struct thread *thread__main_thread(struct machine *machine, struct thread *thread)
+{
+ if (thread->pid_ == thread->tid)
+ return thread__get(thread);
+
+ if (thread->pid_ == -1)
+ return NULL;
+
+ return machine__find_thread(machine, thread->pid_, thread->pid_);
+}
diff --git a/tools/perf/util/thread.h b/tools/perf/util/thread.h
index 45fba13c800b..08fcb14cf637 100644
--- a/tools/perf/util/thread.h
+++ b/tools/perf/util/thread.h
@@ -81,6 +81,8 @@ void thread__insert_map(struct thread *thread, struct map *map);
int thread__fork(struct thread *thread, struct thread *parent, u64 timestamp);
size_t thread__fprintf(struct thread *thread, FILE *fp);
+struct thread *thread__main_thread(struct machine *machine, struct thread *thread);
+
void thread__find_addr_map(struct thread *thread,
u8 cpumode, enum map_type type, u64 addr,
struct addr_location *al);
--
2.5.5
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web