Skip to content

Refactor definitions out of perf.h

Ian Rogers linux-arm-kernel linux-perf-users lkml 2 versions – Applied

Status from this message: Thanks, applied.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 1 replyApplied
  2. v16 patches 5 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/6perf ui: Move window resize signal functionstools/perf/perf.c tools/perf/perf.h tools/perf/ui/setup.c +2 more+22 -210 replies
2/6perf usage: Move usage stringstools/perf/builtin-help.c tools/perf/builtin.h tools/perf/perf.c +2 more+10 -90 replies
3/6perf header: Move perf_version_string declarationtools/perf/builtin-version.c tools/perf/perf.h tools/perf/util/header.h+3 -20 replies
4/6perf version: Use regular verbose flagtools/perf/builtin-version.c tools/perf/perf.c tools/perf/perf.h+3 -50 replies
5/6perf util: Move input_name to utiltools/perf/builtin-annotate.c tools/perf/builtin-buildid-list.c tools/perf/builtin-c2c.c +13 more+16 -140 replies
6/6perf util: Move perf_guest/host declarationstools/perf/builtin-diff.c tools/perf/builtin-kvm.c tools/perf/perf.h +8 more+12 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/6] Refactor definitions out of perf.h

Move definitions and declarations for greater consistency.

The original motivation was, when fuzzing something like parse-events, having the main function in perf.c alongside global variables like input_name means that input_name must be redeclared with the fuzzer function's main. However, as the fuzzer is using the tools/perf code as a library this causes backward linking reference that the linker may warn about.

v2. Remove references from commit messages about linking, as Adrian
points out we could solve that problem with #ifdefs.

Ian Rogers (6):
perf ui: Move window resize signal functions perf usage: Move usage strings
perf header: Move perf_version_string declaration perf version: Use regular verbose flag perf util: Move input_name to util
perf util: Move perf_guest/host declarations

 tools/perf/builtin-annotate.c     |  2 +-
 tools/perf/builtin-buildid-list.c |  2 +-
 tools/perf/builtin-c2c.c          |  2 +-
 tools/perf/builtin-data.c         |  2 +-
 tools/perf/builtin-diff.c         |  2 +-
 tools/perf/builtin-evlist.c       |  2 +-
 tools/perf/builtin-help.c         |  1 +
 tools/perf/builtin-kmem.c         |  2 +-
 tools/perf/builtin-kvm.c          |  1 +
 tools/perf/builtin-kwork.c        |  2 +-
 tools/perf/builtin-mem.c          |  2 +-
 tools/perf/builtin-sched.c        |  2 +-
 tools/perf/builtin-stat.c         |  2 +-
 tools/perf/builtin-timechart.c    |  2 +-
 tools/perf/builtin-version.c      |  7 +++----
 tools/perf/builtin.h              |  3 ---
 tools/perf/perf.c                 | 27 +--------------------------
 tools/perf/perf.h                 |  9 ---------
 tools/perf/ui/browsers/hists.c    |  2 +-
 tools/perf/ui/hist.c              |  2 +-
 tools/perf/ui/setup.c             | 19 +++++++++++++++++++
 tools/perf/ui/tui/setup.c         |  1 -
 tools/perf/ui/ui.h                |  3 +++
 tools/perf/util/cs-etm.c          |  1 +
 tools/perf/util/event.c           |  2 +-
 tools/perf/util/evlist.c          |  1 +
 tools/perf/util/header.h          |  2 ++
 tools/perf/util/parse-events.c    |  2 +-
 tools/perf/util/session.c         |  2 +-
 tools/perf/util/top.c             |  2 +-
 tools/perf/util/usage.c           |  6 ++++++
 tools/perf/util/util.c            |  2 ++
 tools/perf/util/util.h            |  8 ++++++++
 33 files changed, 66 insertions(+), 61 deletions(-)
Signature · 1 line
2.40.0.577.gac1e443424-goog