[PATCH v5 0/2] perf script: Have consistent output for symbol address

Changbin Du posted 2 patches 2 years, 8 months ago
There is a newer version of this series
tools/perf/Documentation/perf-script.txt |  2 +-
tools/perf/builtin-script.c              | 60 ++++++++++--------------
tools/perf/util/evsel_fprintf.c          | 16 +++----
tools/perf/util/evsel_fprintf.h          |  1 +
tools/perf/util/map.c                    | 13 +++++
tools/perf/util/map.h                    |  1 +
6 files changed, 46 insertions(+), 47 deletions(-)
[PATCH v5 0/2] perf script: Have consistent output for symbol address
Posted by Changbin Du 2 years, 8 months ago
The goal of this change is to achieve consistent output for symbol address.
Before this, the raw ip is printed for non-callchain and dso offset for
callchain. Mostly what we expect is the raw ip.

This patch does two changes:
  - Always print raw ip for resolved symbols.
  - Add a new 'dsoff' field if we really need the dso offset, and the
    offset is appended to dso name.

v5:
  o add helper map__fprintf_dsoname_dsoff() to eliminate repeated dso printing code. (Adrian)
  o do not print offset for kernel dso (a.k.a [kernel.kallsyms])
v4:
  o also print 'dsoff' for brstack,brstacksym,brstackoff,etc.
v3:
  o 'dsoff' implys 'dso' field. (Namhyung)
v2:
  o split into two patches. (Adrian)
  o do not print offset for unresolved symbols. (Adrian)

Changbin Du (2):
  perf: add helper map__fprintf_dsoname_dsoff
  perf: script: add new output field 'dsoff' to print dso offset

 tools/perf/Documentation/perf-script.txt |  2 +-
 tools/perf/builtin-script.c              | 60 ++++++++++--------------
 tools/perf/util/evsel_fprintf.c          | 16 +++----
 tools/perf/util/evsel_fprintf.h          |  1 +
 tools/perf/util/map.c                    | 13 +++++
 tools/perf/util/map.h                    |  1 +
 6 files changed, 46 insertions(+), 47 deletions(-)

-- 
2.25.1
Re: [PATCH v5 0/2] perf script: Have consistent output for symbol address
Posted by Changbin Du 2 years, 8 months ago
oops, I missed one patch. please ignore this.

On Tue, Apr 18, 2023 at 11:15:17AM +0800, Changbin Du wrote:
> The goal of this change is to achieve consistent output for symbol address.
> Before this, the raw ip is printed for non-callchain and dso offset for
> callchain. Mostly what we expect is the raw ip.
> 
> This patch does two changes:
>   - Always print raw ip for resolved symbols.
>   - Add a new 'dsoff' field if we really need the dso offset, and the
>     offset is appended to dso name.
> 
> v5:
>   o add helper map__fprintf_dsoname_dsoff() to eliminate repeated dso printing code. (Adrian)
>   o do not print offset for kernel dso (a.k.a [kernel.kallsyms])
> v4:
>   o also print 'dsoff' for brstack,brstacksym,brstackoff,etc.
> v3:
>   o 'dsoff' implys 'dso' field. (Namhyung)
> v2:
>   o split into two patches. (Adrian)
>   o do not print offset for unresolved symbols. (Adrian)
> 
> Changbin Du (2):
>   perf: add helper map__fprintf_dsoname_dsoff
>   perf: script: add new output field 'dsoff' to print dso offset
> 
>  tools/perf/Documentation/perf-script.txt |  2 +-
>  tools/perf/builtin-script.c              | 60 ++++++++++--------------
>  tools/perf/util/evsel_fprintf.c          | 16 +++----
>  tools/perf/util/evsel_fprintf.h          |  1 +
>  tools/perf/util/map.c                    | 13 +++++
>  tools/perf/util/map.h                    |  1 +
>  6 files changed, 46 insertions(+), 47 deletions(-)
> 
> -- 
> 2.25.1
> 

-- 
Cheers,
Changbin Du