All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/9] perf tools: Move perf subcommand framework to a library
@ 2015-12-15 15:39 Josh Poimboeuf
  2015-12-15 15:39 ` [PATCH v4 1/9] tools build: Fix feature Makefile issues with 'O=' Josh Poimboeuf
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: Josh Poimboeuf @ 2015-12-15 15:39 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo
  Cc: linux-kernel, Jiri Olsa, Namhyung Kim

Ingo suggested that I factor out the perf subcommand functionality
(originally copied from git) into tools/lib so that it can be used by
stacktool[*] and possibly others.

All the subcommand option handling files have been moved into a new
library named libsubcmd.a, including parse-options.c, run-command.c,
exec_cmd.c, help.c, usage.c, and pager.c.

Patch 1 is a cleanup I discovered in the process of making the patch
set.  It's completely separate from the rest of the patches and can be
merged independently.

Patches 2-7 are some cleanups and splitting up of the code related to
the creation of the new library.

Patch 8 does the actual moving of the files and creation of the new
libsubcmd.a library in tools/lib/subcmd.

Patch 9 updates the names of the ifdef include guards for the moved .h
files.

Based on acme/perf/core.

These patches can also be found in the 'perf-subcmd-v4' branch in the
following repo:

  https://github.com/jpoimboe/linux


[*] https://lkml.kernel.org/r/cover.1445443144.git.jpoimboe@redhat.com

v4:
- Rebase onto latest acme/perf/core
- Reuse FILES variable instead of creating OUTPUT_FILES in feature
  Makefile
- Make changelogs more verbose
- Move strlcpy() to tools/lib/string.c
- Create shared subcmd_config struct in subcmd-config.c

v3:
- Remove dependencies on util.h, cache.h, abspath, ctype, strbuf, term,
  usage, wrapper
- Move to a new 'libsubcmd' library in tools/lib/subcmd
- Rebase onto Namhyung's patches which remove the browser dependency
  from parse-options.c
- Get rid of the util_cfg struct in favor of file-specific init
  functions
- Split up the patches better
- Document the fact that parse_options*() can exit
- Convert parse-options.c internal functions to static
- Rename exec_cmd.* to exec-cmd.*
- Add new astrcat() and astrcatf() functions to replace strbuf
- Add some more fixes related to 'make O=' and 'make clean' (though
  a 'make clean' is no longer required and these patches are now
  unrelated to libsubcmd)

v2:
- Fix 'make clean' to remove tests/llvm-src-*.c and other leftover
  files
- Fix description for second-to-last patch

Josh Poimboeuf (9):
  tools build: Fix feature Makefile issues with 'O='
  perf tools: Move strlcpy() from perf to tools/lib/string.c
  perf: Document the fact that parse_options*() may exit
  perf: Provide subcmd configuration at runtime
  perf: Remove subcmd dependencies on strbuf
  perf: Remove 'perf' from subcmd function and variable names
  perf: Finalize subcmd independence
  perf subcmd: Create subcmd library
  tools subcmd: Rename subcmd header include guards

 tools/build/Makefile.feature                    |   2 +-
 tools/build/feature/Makefile                    |  93 +++++------
 tools/include/linux/string.h                    |   4 +
 tools/lib/string.c                              |  27 +++
 tools/lib/subcmd/Build                          |   7 +
 tools/lib/subcmd/Makefile                       |  48 ++++++
 tools/lib/subcmd/exec-cmd.c                     | 209 ++++++++++++++++++++++++
 tools/lib/subcmd/exec-cmd.h                     |  16 ++
 tools/{perf/util => lib/subcmd}/help.c          |  63 +++++--
 tools/{perf/util => lib/subcmd}/help.h          |  10 +-
 tools/{perf/util => lib/subcmd}/pager.c         |  15 +-
 tools/lib/subcmd/pager.h                        |   9 +
 tools/{perf/util => lib/subcmd}/parse-options.c | 116 +++++++------
 tools/{perf/util => lib/subcmd}/parse-options.h |  12 +-
 tools/{perf/util => lib/subcmd}/run-command.c   |  24 ++-
 tools/{perf/util => lib/subcmd}/run-command.h   |  12 +-
 tools/{perf/util => lib/subcmd}/sigchain.c      |   3 +-
 tools/{perf/util => lib/subcmd}/sigchain.h      |   6 +-
 tools/lib/subcmd/subcmd-config.c                |  11 ++
 tools/lib/subcmd/subcmd-config.h                |  14 ++
 tools/lib/subcmd/subcmd-util.h                  |  91 +++++++++++
 tools/perf/Build                                |   5 +-
 tools/perf/MANIFEST                             |   1 +
 tools/perf/Makefile.perf                        |  20 ++-
 tools/perf/arch/x86/util/intel-pt.c             |   2 +-
 tools/perf/bench/futex-hash.c                   |   2 +-
 tools/perf/bench/futex-lock-pi.c                |   2 +-
 tools/perf/bench/futex-requeue.c                |   2 +-
 tools/perf/bench/futex-wake-parallel.c          |   2 +-
 tools/perf/bench/futex-wake.c                   |   2 +-
 tools/perf/bench/mem-functions.c                |   2 +-
 tools/perf/bench/numa.c                         |   2 +-
 tools/perf/bench/sched-messaging.c              |   2 +-
 tools/perf/bench/sched-pipe.c                   |   2 +-
 tools/perf/builtin-annotate.c                   |   2 +-
 tools/perf/builtin-bench.c                      |   2 +-
 tools/perf/builtin-buildid-cache.c              |   2 +-
 tools/perf/builtin-buildid-list.c               |   2 +-
 tools/perf/builtin-config.c                     |   2 +-
 tools/perf/builtin-data.c                       |   2 +-
 tools/perf/builtin-evlist.c                     |   2 +-
 tools/perf/builtin-help.c                       |  10 +-
 tools/perf/builtin-inject.c                     |   2 +-
 tools/perf/builtin-kmem.c                       |   2 +-
 tools/perf/builtin-kvm.c                        |   2 +-
 tools/perf/builtin-list.c                       |   2 +-
 tools/perf/builtin-lock.c                       |   2 +-
 tools/perf/builtin-mem.c                        |   2 +-
 tools/perf/builtin-probe.c                      |   2 +-
 tools/perf/builtin-record.c                     |   2 +-
 tools/perf/builtin-report.c                     |   2 +-
 tools/perf/builtin-sched.c                      |   2 +-
 tools/perf/builtin-script.c                     |  12 +-
 tools/perf/builtin-stat.c                       |   2 +-
 tools/perf/builtin-timechart.c                  |   2 +-
 tools/perf/builtin-top.c                        |   2 +-
 tools/perf/builtin-trace.c                      |   4 +-
 tools/perf/perf.c                               |  18 +-
 tools/perf/tests/attr.c                         |   4 +-
 tools/perf/tests/builtin-test.c                 |   2 +-
 tools/perf/util/Build                           |   7 -
 tools/perf/util/auxtrace.c                      |   2 +-
 tools/perf/util/cache.h                         |  10 +-
 tools/perf/util/cgroup.c                        |   2 +-
 tools/perf/util/config.c                        |   2 +-
 tools/perf/util/evlist.c                        |   2 +-
 tools/perf/util/exec_cmd.c                      | 149 -----------------
 tools/perf/util/exec_cmd.h                      |  13 --
 tools/perf/util/help-unknown-cmd.c              |   2 +-
 tools/perf/util/pager.h                         |   7 -
 tools/perf/util/parse-branch-options.c          |   2 +-
 tools/perf/util/parse-events.c                  |   4 +-
 tools/perf/util/parse-regs-options.c            |   2 +-
 tools/perf/util/path.c                          |  18 --
 tools/perf/util/sort.h                          |   2 +-
 tools/perf/util/util.h                          |  14 --
 76 files changed, 749 insertions(+), 417 deletions(-)
 create mode 100644 tools/lib/subcmd/Build
 create mode 100644 tools/lib/subcmd/Makefile
 create mode 100644 tools/lib/subcmd/exec-cmd.c
 create mode 100644 tools/lib/subcmd/exec-cmd.h
 rename tools/{perf/util => lib/subcmd}/help.c (81%)
 rename tools/{perf/util => lib/subcmd}/help.h (87%)
 rename tools/{perf/util => lib/subcmd}/pager.c (85%)
 create mode 100644 tools/lib/subcmd/pager.h
 rename tools/{perf/util => lib/subcmd}/parse-options.c (90%)
 rename tools/{perf/util => lib/subcmd}/parse-options.h (96%)
 rename tools/{perf/util => lib/subcmd}/run-command.c (90%)
 rename tools/{perf/util => lib/subcmd}/run-command.h (86%)
 rename tools/{perf/util => lib/subcmd}/sigchain.c (95%)
 rename tools/{perf/util => lib/subcmd}/sigchain.h (55%)
 create mode 100644 tools/lib/subcmd/subcmd-config.c
 create mode 100644 tools/lib/subcmd/subcmd-config.h
 create mode 100644 tools/lib/subcmd/subcmd-util.h
 delete mode 100644 tools/perf/util/exec_cmd.c
 delete mode 100644 tools/perf/util/exec_cmd.h
 delete mode 100644 tools/perf/util/pager.h

-- 
2.4.3


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2015-12-18  8:55 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-15 15:39 [PATCH v4 0/9] perf tools: Move perf subcommand framework to a library Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 1/9] tools build: Fix feature Makefile issues with 'O=' Josh Poimboeuf
2015-12-18  8:51   ` [tip:perf/core] tools build: Fix feature Makefile issues with 'O= ' tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 2/9] perf tools: Move strlcpy() from perf to tools/lib/string.c Josh Poimboeuf
2015-12-18  8:52   ` [tip:perf/core] perf tools: Move strlcpy() from perf to tools/lib /string.c tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 3/9] perf: Document the fact that parse_options*() may exit Josh Poimboeuf
2015-12-18  8:52   ` [tip:perf/core] perf tools: Document the fact that parse_options* () " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 4/9] perf: Provide subcmd configuration at runtime Josh Poimboeuf
2015-12-18  8:53   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 5/9] perf: Remove subcmd dependencies on strbuf Josh Poimboeuf
2015-12-18  8:53   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 6/9] perf: Remove 'perf' from subcmd function and variable names Josh Poimboeuf
2015-12-18  8:53   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 7/9] perf: Finalize subcmd independence Josh Poimboeuf
2015-12-17  0:57   ` Arnaldo Carvalho de Melo
2015-12-17  1:09     ` Josh Poimboeuf
2015-12-17  1:27       ` Arnaldo Carvalho de Melo
2015-12-17  4:12         ` Josh Poimboeuf
2015-12-18  8:54   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 8/9] perf subcmd: Create subcmd library Josh Poimboeuf
2015-12-18  8:54   ` [tip:perf/core] " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 9/9] tools subcmd: Rename subcmd header include guards Josh Poimboeuf
2015-12-18  8:54   ` [tip:perf/core] " tip-bot for Josh Poimboeuf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.