perf/core improvements and fixes
Subsystems (7)
Arnaldo Carvalho de Melo
maintainerPATCH 89/91 libsymbols kallsyms: Move hex2u64 out of header
In reply to Arnaldo Carvalho de MeloFrom: Ian Rogers <[email protected]>
hex2u64 is a helper that's out of place in kallsyms.h as not being kallsyms related. Move from kallsyms.h to the only user.
Committer notes:
Move it out of tools/lib/symbol/kallsyms.c as well, as we had to leave it there in the previous patch lest we break the build.
--- tools/lib/symbol/kallsyms.c | 13 ------------- tools/lib/symbol/kallsyms.h | 2 -- tools/perf/util/symbol.c | 14 ++++++++++++++ 3 files changed, 14 insertions(+), 15 deletions(-)
tools/lib/symbol/kallsyms.c +0 -13
@@ -11,19 +11,6 @@ u8 kallsyms2elf_type(char type)return (type =='t' || type =='w' ) ?STT_FUNC :STT_OBJECT ; } -/* -* While we find nice hex chars, build a long_val. -* Return number of chars processed. -*/ -int hex2u64 (const char *ptr,u64 *long_val) -{ -char *p; - - *long_val =strtoull (ptr, &p,16 ); - -return p - ptr; -} -bool kallsyms__is_function (char symbol_type) { symbol_type =toupper (symbol_type);
tools/lib/symbol/kallsyms.h +0 -2
@@ -18,8 +18,6 @@ static inline u8 kallsyms2elf_binding(char type)return isupper (type) ?STB_GLOBAL :STB_LOCAL ; } -int hex2u64 (const char *ptr,u64 *long_val); -u8 kallsyms2elf_type (char type);bool kallsyms__is_function (char symbol_type);
tools/perf/util/symbol.c +14 -0
@@ -566,6 +566,20 @@ void dso__sort_by_name(struct dso *dso)return symbols__sort_by_name (&dso->symbol_names, &dso->symbols); } +/* +* While we find nice hex chars, build a long_val. +* Return number of chars processed. +*/ +static int hex2u64 (const char *ptr,u64 *long_val) +{ +char *p; + + *long_val =strtoull (ptr, &p,16 ); + +return p - ptr; +} + +int modules__parse (const char *filename,void *arg,int (*process_module)(void *arg,const char *name,u64 start,u64 size))
Signature · 1 line
2.21.1
Arnaldo Carvalho de Melo
maintainerPATCH 90/91 perf cs-etm: Move definition of 'traceid_list' global variable from header file
In reply to Arnaldo Carvalho de MeloFrom: Leo Yan <[email protected]>
The variable 'traceid_list' is defined in the header file cs-etm.h, if multiple C files include cs-etm.h the compiler might complaint for multiple definition of 'traceid_list'.
To fix multiple definition error, move the definition of 'traceid_list' into cs-etm.c.
--- tools/perf/util/cs-etm.c | 3 +++ tools/perf/util/cs-etm.h | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-)
tools/perf/util/cs-etm.c +3 -0
@@ -94,6 +94,9 @@ struct cs_etm_queue {struct cs_etm_traceid_queue **traceid_queues; }; +/* RB tree for quick conversion between traceID and metadata pointers */ +static struct intlist *traceid_list; +static int cs_etm__update_queues (struct cs_etm_auxtrace *etm);static int cs_etm__process_queues (struct cs_etm_auxtrace *etm); static int cs_etm__process_timeless_queues(struct cs_etm_auxtrace *etm,
tools/perf/util/cs-etm.h +0 -3
@@ -114,9 +114,6 @@ enum cs_etm_isa { CS_ETM_ISA_T32, }; -/* RB tree for quick conversion between traceID and metadata pointers */ -struct intlist *traceid_list; -struct cs_etm_queue ;struct cs_etm_packet {
Signature · 1 line
2.21.1
Arnaldo Carvalho de Melo
maintainerPATCH 91/91 perf flamegraph: Use /bin/bash for report and record scripts
In reply to Arnaldo Carvalho de MeloFrom: Arnaldo Carvalho de Melo <[email protected]>
As all the other tools/perf/scripts/python/bin/*-{report,record} scripts, fixing the this problem reported by Daniel Diaz:
Our OpenEmbedded builds detected an issue with 5287f9269206 ("perf
script: Add flamegraph.py script"):
ERROR: perf-1.0-r9 do_package_qa: QA Issue:
/usr/libexec/perf-core/scripts/python/bin/flamegraph-report contained in package perf-python requires /usr/bin/sh, but no providers found in RDEPENDS_perf-python? [file-rdeps]
This means that there is a new binary pulled in in the shebang line which was unaccounted for: /usr/bin/sh. I don't see any other usage of /usr/bin/sh in the kernel tree (does not even exist on my Ubuntu dev machine) but plenty of /bin/sh. This patch is needed:
-----8<----------8<----------8<-----
diff --git a/tools/perf/scripts/python/bin/flamegraph-record b/tools/perf/scripts/python/bin/flamegraph-record
index 725d66e71570..a2f3fa25ef81 100755
--- a/tools/perf/scripts/python/bin/flamegraph-record
+++ b/tools/perf/scripts/python/bin/flamegraph-record
@@ -1,2 +1,2 @@
-#!/usr/bin/sh
+#!/bin/sh
perf record -g "$@"
diff --git a/tools/perf/scripts/python/bin/flamegraph-report b/tools/perf/scripts/python/bin/flamegraph-report
index b1a79afd903b..b0177355619b 100755
--- a/tools/perf/scripts/python/bin/flamegraph-report
+++ b/tools/perf/scripts/python/bin/flamegraph-report
@@ -1,3 +1,3 @@
-#!/usr/bin/sh
+#!/bin/sh
# description: create flame graphs
perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@"
----->8---------->8---------->8-----
--- tools/perf/scripts/python/bin/flamegraph-record | 2 +- tools/perf/scripts/python/bin/flamegraph-report | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
tools/perf/scripts/python/bin/flamegraph-record +1 -1
@@ -1,2 +1,2 @@ -#!/usr/bin/sh +#!/bin/bash perf record -g "$@"
tools/perf/scripts/python/bin/flamegraph-report +1 -1
@@ -1,3 +1,3 @@ -#!/usr/bin/sh +#!/bin/bash # description: create flame graphs perf script -s "$PERF_EXEC_PATH"/scripts/python/flamegraph.py -- "$@"
Signature · 1 line
2.21.1