Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1401241 > unrolled thread
| Started by | Masami Hiramatsu <mhiramat@kernel.org> |
|---|---|
| First post | 2016-05-16 04:10 +0200 |
| Last post | 2016-05-20 13:10 +0200 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH perf/core v8 00/16] perf-probe --cache and SDT support Masami Hiramatsu <mhiramat@kernel.org> - 2016-05-16 04:10 +0200
[PATCH perf/core v8 01/16] perf buildid: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE Masami Hiramatsu <mhiramat@kernel.org> - 2016-05-16 04:10 +0200
[tip:perf/urgent] perf symbols: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE tip-bot for Masami Hiramatsu <tipbot@zytor.com> - 2016-05-20 08:50 +0200
Re: [PATCH perf/core v8 00/16] perf-probe --cache and SDT support Hemant Kumar <hemant@linux.vnet.ibm.com> - 2016-05-20 07:00 +0200
Re: [PATCH perf/core v8 00/16] perf-probe --cache and SDT support Masami Hiramatsu <mhiramat@kernel.org> - 2016-05-20 13:10 +0200
| From | Masami Hiramatsu <mhiramat@kernel.org> |
|---|---|
| Date | 2016-05-16 04:10 +0200 |
| Subject | [PATCH perf/core v8 00/16] perf-probe --cache and SDT support |
| Message-ID | <rzg8O-u7-27@gated-at.bofh.it> |
Hi,
Here is the 8th version of the patchset for probe-cache and
initial SDT support.
The previous version is here; https://lkml.org/lkml/2016/5/11/446
This version I droped the second patch in v7 because it may
involves unintended behavior change and we'd better discuss it
out of this series. I also added comments why we can't use
access(R_OK) for /proc/kcore.
Hemant, could you review and test this series so that we can
proceed to your patch depending on this?
Thank you,
---
Hemant Kumar (1):
perf/sdt: ELF support for SDT
Masami Hiramatsu (15):
perf buildid: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE
perf symbol: Cleanup the code flow of dso__find_kallsyms
perf-buildid-cache: Use path/to/bin/buildid/elf instead of path/to/bin/buildid
perf probe: Add --cache option to cache the probe definitions
perf probe: Use cache entry if possible
perf probe: Show all cached probes
perf probe: Remove caches when --cache is given
perf probe: Add group name support
perf buildid-cache: Scan and import user SDT events to probe cache
perf probe: Accept %sdt and %cached event name
perf-list: Show SDT and pre-cached events
perf-list: Skip SDTs placed in invalid binaries
perf probe: Allow wildcard for cached events
perf probe: Support @BUILDID or @FILE suffix for SDT events
perf probe: Support a special SDT probe format
tools/perf/Documentation/perf-probe.txt | 26 +-
tools/perf/builtin-buildid-cache.c | 8
tools/perf/builtin-list.c | 4
tools/perf/builtin-probe.c | 30 ++
tools/perf/util/annotate.c | 2
tools/perf/util/build-id.c | 295 ++++++++++++++++--
tools/perf/util/build-id.h | 8
tools/perf/util/dso.h | 5
tools/perf/util/machine.c | 2
tools/perf/util/parse-events.c | 83 +++++
tools/perf/util/parse-events.h | 2
tools/perf/util/probe-event.c | 492 +++++++++++++++++++++++++++---
tools/perf/util/probe-event.h | 7
tools/perf/util/probe-file.c | 502 +++++++++++++++++++++++++++++++
tools/perf/util/probe-file.h | 41 +++
tools/perf/util/symbol-elf.c | 252 ++++++++++++++++
tools/perf/util/symbol.c | 73 ++---
tools/perf/util/symbol.h | 25 ++
18 files changed, 1719 insertions(+), 138 deletions(-)
--
Masami Hiramatsu
[toc] | [next] | [standalone]
| From | Masami Hiramatsu <mhiramat@kernel.org> |
|---|---|
| Date | 2016-05-16 04:10 +0200 |
| Subject | [PATCH perf/core v8 01/16] perf buildid: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE |
| Message-ID | <rzg8Y-u7-285@gated-at.bofh.it> |
| In reply to | #1401241 |
Instead of using raw string, use DSO__NAME_KALLSYMS and DSO__NAME_KCORE
macros for kallsyms and kcore.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
---
tools/perf/builtin-buildid-cache.c | 8 ++++----
tools/perf/util/annotate.c | 2 +-
tools/perf/util/machine.c | 2 +-
tools/perf/util/symbol.c | 10 +++++-----
tools/perf/util/symbol.h | 3 +++
5 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index 632efc6..d75bded 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -119,8 +119,8 @@ static int build_id_cache__add_kcore(const char *filename, bool force)
if (build_id_cache__kcore_buildid(from_dir, sbuildid) < 0)
return -1;
- scnprintf(to_dir, sizeof(to_dir), "%s/[kernel.kcore]/%s",
- buildid_dir, sbuildid);
+ scnprintf(to_dir, sizeof(to_dir), "%s/%s/%s",
+ buildid_dir, DSO__NAME_KCORE, sbuildid);
if (!force &&
!build_id_cache__kcore_existing(from_dir, to_dir, sizeof(to_dir))) {
@@ -131,8 +131,8 @@ static int build_id_cache__add_kcore(const char *filename, bool force)
if (build_id_cache__kcore_dir(dir, sizeof(dir)))
return -1;
- scnprintf(to_dir, sizeof(to_dir), "%s/[kernel.kcore]/%s/%s",
- buildid_dir, sbuildid, dir);
+ scnprintf(to_dir, sizeof(to_dir), "%s/%s/%s/%s",
+ buildid_dir, DSO__NAME_KCORE, sbuildid, dir);
if (mkdir_p(to_dir, 0755))
return -1;
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 4db73d5..b811924 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1122,7 +1122,7 @@ int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize)
} else if (dso__is_kcore(dso)) {
goto fallback;
} else if (readlink(symfs_filename, command, sizeof(command)) < 0 ||
- strstr(command, "[kernel.kallsyms]") ||
+ strstr(command, DSO__NAME_KALLSYMS) ||
access(symfs_filename, R_OK)) {
free(filename);
fallback:
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 639a290..18dd96b 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -709,7 +709,7 @@ static struct dso *machine__get_kernel(struct machine *machine)
if (machine__is_host(machine)) {
vmlinux_name = symbol_conf.vmlinux_name;
if (!vmlinux_name)
- vmlinux_name = "[kernel.kallsyms]";
+ vmlinux_name = DSO__NAME_KALLSYMS;
kernel = machine__findnew_kernel(machine, vmlinux_name,
"[kernel]", DSO_TYPE_KERNEL);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 7fb3330..2252b54 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1662,8 +1662,8 @@ static char *dso__find_kallsyms(struct dso *dso, struct map *map)
build_id__sprintf(dso->build_id, sizeof(dso->build_id), sbuild_id);
- scnprintf(path, sizeof(path), "%s/[kernel.kcore]/%s", buildid_dir,
- sbuild_id);
+ scnprintf(path, sizeof(path), "%s/%s/%s", buildid_dir,
+ DSO__NAME_KCORE, sbuild_id);
/* Use /proc/kallsyms if possible */
if (is_host) {
@@ -1699,8 +1699,8 @@ static char *dso__find_kallsyms(struct dso *dso, struct map *map)
if (!find_matching_kcore(map, path, sizeof(path)))
return strdup(path);
- scnprintf(path, sizeof(path), "%s/[kernel.kallsyms]/%s",
- buildid_dir, sbuild_id);
+ scnprintf(path, sizeof(path), "%s/%s/%s",
+ buildid_dir, DSO__NAME_KALLSYMS, sbuild_id);
if (access(path, F_OK)) {
pr_err("No kallsyms or vmlinux with build-id %s was found\n",
@@ -1769,7 +1769,7 @@ do_kallsyms:
if (err > 0 && !dso__is_kcore(dso)) {
dso->binary_type = DSO_BINARY_TYPE__KALLSYMS;
- dso__set_long_name(dso, "[kernel.kallsyms]", false);
+ dso__set_long_name(dso, DSO__NAME_KALLSYMS, false);
map__fixup_start(map);
map__fixup_end(map);
}
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 2b5e4ed..25f2fd67 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -44,6 +44,9 @@ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
#endif
+#define DSO__NAME_KALLSYMS "[kernel.kallsyms]"
+#define DSO__NAME_KCORE "[kernel.kcore]"
+
/** struct symbol - symtab entry
*
* @ignore - resolvable but tools ignore it (e.g. idle routines)
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Masami Hiramatsu <tipbot@zytor.com> |
|---|---|
| Date | 2016-05-20 08:50 +0200 |
| Subject | [tip:perf/urgent] perf symbols: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE |
| Message-ID | <rAMpX-25Y-9@gated-at.bofh.it> |
| In reply to | #1401251 |
Commit-ID: 0a77582f0407e7f9b5d775bebc31297a1b890be0
Gitweb: http://git.kernel.org/tip/0a77582f0407e7f9b5d775bebc31297a1b890be0
Author: Masami Hiramatsu <mhiramat@kernel.org>
AuthorDate: Sun, 15 May 2016 12:19:40 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 16 May 2016 23:11:48 -0300
perf symbols: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE
Instead of using a raw string, use DSO__NAME_KALLSYMS and
DSO__NAME_KCORE macros for kallsyms and kcore.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>
Cc: Brendan Gregg <brendan.d.gregg@gmail.com>
Cc: Hemant Kumar <hemant@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20160515031935.4017.50971.stgit@devbox
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-buildid-cache.c | 8 ++++----
tools/perf/util/annotate.c | 2 +-
tools/perf/util/machine.c | 2 +-
tools/perf/util/symbol.c | 10 +++++-----
tools/perf/util/symbol.h | 3 +++
5 files changed, 14 insertions(+), 11 deletions(-)
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index 632efc6..d75bded 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -119,8 +119,8 @@ static int build_id_cache__add_kcore(const char *filename, bool force)
if (build_id_cache__kcore_buildid(from_dir, sbuildid) < 0)
return -1;
- scnprintf(to_dir, sizeof(to_dir), "%s/[kernel.kcore]/%s",
- buildid_dir, sbuildid);
+ scnprintf(to_dir, sizeof(to_dir), "%s/%s/%s",
+ buildid_dir, DSO__NAME_KCORE, sbuildid);
if (!force &&
!build_id_cache__kcore_existing(from_dir, to_dir, sizeof(to_dir))) {
@@ -131,8 +131,8 @@ static int build_id_cache__add_kcore(const char *filename, bool force)
if (build_id_cache__kcore_dir(dir, sizeof(dir)))
return -1;
- scnprintf(to_dir, sizeof(to_dir), "%s/[kernel.kcore]/%s/%s",
- buildid_dir, sbuildid, dir);
+ scnprintf(to_dir, sizeof(to_dir), "%s/%s/%s/%s",
+ buildid_dir, DSO__NAME_KCORE, sbuildid, dir);
if (mkdir_p(to_dir, 0755))
return -1;
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 4db73d5..b811924 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1122,7 +1122,7 @@ int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize)
} else if (dso__is_kcore(dso)) {
goto fallback;
} else if (readlink(symfs_filename, command, sizeof(command)) < 0 ||
- strstr(command, "[kernel.kallsyms]") ||
+ strstr(command, DSO__NAME_KALLSYMS) ||
access(symfs_filename, R_OK)) {
free(filename);
fallback:
diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
index 639a290..18dd96b 100644
--- a/tools/perf/util/machine.c
+++ b/tools/perf/util/machine.c
@@ -709,7 +709,7 @@ static struct dso *machine__get_kernel(struct machine *machine)
if (machine__is_host(machine)) {
vmlinux_name = symbol_conf.vmlinux_name;
if (!vmlinux_name)
- vmlinux_name = "[kernel.kallsyms]";
+ vmlinux_name = DSO__NAME_KALLSYMS;
kernel = machine__findnew_kernel(machine, vmlinux_name,
"[kernel]", DSO_TYPE_KERNEL);
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 7fb3330..2252b54 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1662,8 +1662,8 @@ static char *dso__find_kallsyms(struct dso *dso, struct map *map)
build_id__sprintf(dso->build_id, sizeof(dso->build_id), sbuild_id);
- scnprintf(path, sizeof(path), "%s/[kernel.kcore]/%s", buildid_dir,
- sbuild_id);
+ scnprintf(path, sizeof(path), "%s/%s/%s", buildid_dir,
+ DSO__NAME_KCORE, sbuild_id);
/* Use /proc/kallsyms if possible */
if (is_host) {
@@ -1699,8 +1699,8 @@ static char *dso__find_kallsyms(struct dso *dso, struct map *map)
if (!find_matching_kcore(map, path, sizeof(path)))
return strdup(path);
- scnprintf(path, sizeof(path), "%s/[kernel.kallsyms]/%s",
- buildid_dir, sbuild_id);
+ scnprintf(path, sizeof(path), "%s/%s/%s",
+ buildid_dir, DSO__NAME_KALLSYMS, sbuild_id);
if (access(path, F_OK)) {
pr_err("No kallsyms or vmlinux with build-id %s was found\n",
@@ -1769,7 +1769,7 @@ do_kallsyms:
if (err > 0 && !dso__is_kcore(dso)) {
dso->binary_type = DSO_BINARY_TYPE__KALLSYMS;
- dso__set_long_name(dso, "[kernel.kallsyms]", false);
+ dso__set_long_name(dso, DSO__NAME_KALLSYMS, false);
map__fixup_start(map);
map__fixup_end(map);
}
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 2b5e4ed..25f2fd67 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -44,6 +44,9 @@ Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
#define DMGL_ANSI (1 << 1) /* Include const, volatile, etc */
#endif
+#define DSO__NAME_KALLSYMS "[kernel.kallsyms]"
+#define DSO__NAME_KCORE "[kernel.kcore]"
+
/** struct symbol - symtab entry
*
* @ignore - resolvable but tools ignore it (e.g. idle routines)
[toc] | [prev] | [next] | [standalone]
| From | Hemant Kumar <hemant@linux.vnet.ibm.com> |
|---|---|
| Date | 2016-05-20 07:00 +0200 |
| Message-ID | <rAKHv-10c-5@gated-at.bofh.it> |
| In reply to | #1401241 |
On 05/15/2016 08:49 AM, Masami Hiramatsu wrote:
> Hi,
>
> Here is the 8th version of the patchset for probe-cache and
> initial SDT support.
>
> The previous version is here; https://lkml.org/lkml/2016/5/11/446
>
> This version I droped the second patch in v7 because it may
> involves unintended behavior change and we'd better discuss it
> out of this series. I also added comments why we can't use
> access(R_OK) for /proc/kcore.
>
> Hemant, could you review and test this series so that we can
> proceed to your patch depending on this?
So, apart from the two issues which I mentioned in
the individual patches, it seems fine.
However, I think we will need a bit detailed documentation for the
probe cache feature as well as for the SDT support, given that we
have different commands to add {probe,sdt} events for a binary
and use them. I will write that that doc up based on your next
version.
>
> Thank you,
>
> ---
>
> Hemant Kumar (1):
> perf/sdt: ELF support for SDT
>
> Masami Hiramatsu (15):
> perf buildid: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE
> perf symbol: Cleanup the code flow of dso__find_kallsyms
> perf-buildid-cache: Use path/to/bin/buildid/elf instead of path/to/bin/buildid
> perf probe: Add --cache option to cache the probe definitions
> perf probe: Use cache entry if possible
> perf probe: Show all cached probes
> perf probe: Remove caches when --cache is given
> perf probe: Add group name support
> perf buildid-cache: Scan and import user SDT events to probe cache
> perf probe: Accept %sdt and %cached event name
> perf-list: Show SDT and pre-cached events
> perf-list: Skip SDTs placed in invalid binaries
> perf probe: Allow wildcard for cached events
> perf probe: Support @BUILDID or @FILE suffix for SDT events
> perf probe: Support a special SDT probe format
>
>
> tools/perf/Documentation/perf-probe.txt | 26 +-
> tools/perf/builtin-buildid-cache.c | 8
> tools/perf/builtin-list.c | 4
> tools/perf/builtin-probe.c | 30 ++
> tools/perf/util/annotate.c | 2
> tools/perf/util/build-id.c | 295 ++++++++++++++++--
> tools/perf/util/build-id.h | 8
> tools/perf/util/dso.h | 5
> tools/perf/util/machine.c | 2
> tools/perf/util/parse-events.c | 83 +++++
> tools/perf/util/parse-events.h | 2
> tools/perf/util/probe-event.c | 492 +++++++++++++++++++++++++++---
> tools/perf/util/probe-event.h | 7
> tools/perf/util/probe-file.c | 502 +++++++++++++++++++++++++++++++
> tools/perf/util/probe-file.h | 41 +++
> tools/perf/util/symbol-elf.c | 252 ++++++++++++++++
> tools/perf/util/symbol.c | 73 ++---
> tools/perf/util/symbol.h | 25 ++
> 18 files changed, 1719 insertions(+), 138 deletions(-)
>
> --
> Masami Hiramatsu
>
--
Thanks,
Hemant Kumar
[toc] | [prev] | [next] | [standalone]
| From | Masami Hiramatsu <mhiramat@kernel.org> |
|---|---|
| Date | 2016-05-20 13:10 +0200 |
| Message-ID | <rAQtz-4Kg-5@gated-at.bofh.it> |
| In reply to | #1404130 |
On Fri, 20 May 2016 10:21:09 +0530
Hemant Kumar <hemant@linux.vnet.ibm.com> wrote:
>
>
> On 05/15/2016 08:49 AM, Masami Hiramatsu wrote:
> > Hi,
> >
> > Here is the 8th version of the patchset for probe-cache and
> > initial SDT support.
> >
> > The previous version is here; https://lkml.org/lkml/2016/5/11/446
> >
> > This version I droped the second patch in v7 because it may
> > involves unintended behavior change and we'd better discuss it
> > out of this series. I also added comments why we can't use
> > access(R_OK) for /proc/kcore.
> >
> > Hemant, could you review and test this series so that we can
> > proceed to your patch depending on this?
>
> So, apart from the two issues which I mentioned in
> the individual patches, it seems fine.
Thanks! I'll fix those issues and send v9.
> However, I think we will need a bit detailed documentation for the
> probe cache feature as well as for the SDT support, given that we
> have different commands to add {probe,sdt} events for a binary
> and use them. I will write that that doc up based on your next
> version.
Would you mean updating Documentation/perf-probe.txt?
Anyway it is welcome your contribution!
Thank you,
>
> >
> > Thank you,
> >
> > ---
> >
> > Hemant Kumar (1):
> > perf/sdt: ELF support for SDT
> >
> > Masami Hiramatsu (15):
> > perf buildid: Introduce DSO__NAME_KALLSYMS and DSO__NAME_KCORE
> > perf symbol: Cleanup the code flow of dso__find_kallsyms
> > perf-buildid-cache: Use path/to/bin/buildid/elf instead of path/to/bin/buildid
> > perf probe: Add --cache option to cache the probe definitions
> > perf probe: Use cache entry if possible
> > perf probe: Show all cached probes
> > perf probe: Remove caches when --cache is given
> > perf probe: Add group name support
> > perf buildid-cache: Scan and import user SDT events to probe cache
> > perf probe: Accept %sdt and %cached event name
> > perf-list: Show SDT and pre-cached events
> > perf-list: Skip SDTs placed in invalid binaries
> > perf probe: Allow wildcard for cached events
> > perf probe: Support @BUILDID or @FILE suffix for SDT events
> > perf probe: Support a special SDT probe format
> >
> >
> > tools/perf/Documentation/perf-probe.txt | 26 +-
> > tools/perf/builtin-buildid-cache.c | 8
> > tools/perf/builtin-list.c | 4
> > tools/perf/builtin-probe.c | 30 ++
> > tools/perf/util/annotate.c | 2
> > tools/perf/util/build-id.c | 295 ++++++++++++++++--
> > tools/perf/util/build-id.h | 8
> > tools/perf/util/dso.h | 5
> > tools/perf/util/machine.c | 2
> > tools/perf/util/parse-events.c | 83 +++++
> > tools/perf/util/parse-events.h | 2
> > tools/perf/util/probe-event.c | 492 +++++++++++++++++++++++++++---
> > tools/perf/util/probe-event.h | 7
> > tools/perf/util/probe-file.c | 502 +++++++++++++++++++++++++++++++
> > tools/perf/util/probe-file.h | 41 +++
> > tools/perf/util/symbol-elf.c | 252 ++++++++++++++++
> > tools/perf/util/symbol.c | 73 ++---
> > tools/perf/util/symbol.h | 25 ++
> > 18 files changed, 1719 insertions(+), 138 deletions(-)
> >
> > --
> > Masami Hiramatsu
> >
>
> --
> Thanks,
> Hemant Kumar
>
--
Masami Hiramatsu <mhiramat@kernel.org>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web