linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/14] perf tools: Move perf subcommand framework into lib/tools
@ 2015-12-08  4:21 Josh Poimboeuf
  2015-12-08  4:21 ` [PATCH v2 01/14] perf: Fix 'make clean' Josh Poimboeuf
                   ` (14 more replies)
  0 siblings, 15 replies; 46+ messages in thread
From: Josh Poimboeuf @ 2015-12-08  4:21 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 libapi,
including parse-options.c, run-command.c, exec_cmd.c, help.c, usage.c,
and their dependencies.  Since several of the dependencies are more
general-purpose "utilities" which aren't directly related to
subcommands, I put everything in 'tools/lib/api/util'.  They're linked
into perf as part of the libapi.a library.

Patches 1-13 do some cleanups and splitting up of the code in
preparation for the move.

Patch 14 does the actual moving of the files into tools/lib/api/util.

Based on tip/perf/core.

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

v2:
- Fix 'make clean' to remove tests/llvm-src-*.c and other leftover
  files
- Fix description for "Move tools/lib/string.c to libapi" patch

Josh Poimboeuf (14):
  perf: Fix 'make clean'
  perf: Use -iquote for local include paths
  perf: Split up util.h
  perf: Move term functions out of util.c
  perf: Remove unused pager_use_color variable
  perf: Split up cache.h
  perf: Remove cache.h
  perf: Save cmdline arguments earlier
  perf: Remove check for unused PERF_PAGER_IN_USE
  perf: Move cmd_version() to builtin-version.c
  perf: Move help_unknown_cmd() to its own file
  perf tools: Move strlcpy() to tools/lib/string.c
  perf tools: Move tools/lib/string.c to libapi
  perf tools: Move subcommand framework and related utils to libapi

 tools/include/asm-generic/bitops/__fls.h           |   2 +-
 tools/include/asm-generic/bitops/fls.h             |   2 +-
 tools/include/asm-generic/bitops/fls64.h           |   2 +-
 tools/lib/api/Build                                |   2 +
 tools/lib/api/Makefile                             |   6 +-
 tools/lib/api/string/Build                         |   1 +
 tools/lib/{ => api/string}/string.c                |  24 +-
 tools/{include/linux => lib/api/string}/string.h   |  15 +-
 tools/lib/api/util/Build                           |  13 +
 tools/{perf => lib/api}/util/abspath.c             |   6 +-
 tools/lib/api/util/abspath.h                       |  11 +
 tools/lib/api/util/cfg.c                           |  12 +
 tools/lib/api/util/cfg.h                           |  15 +
 tools/lib/api/util/compat-util.h                   | 129 +++++++++
 tools/{perf => lib/api}/util/ctype.c               |   3 +-
 tools/lib/api/util/ctype.h                         |  52 ++++
 tools/{perf => lib/api}/util/exec_cmd.c            |  42 +--
 tools/{perf => lib/api}/util/exec_cmd.h            |  18 +-
 tools/{perf => lib/api}/util/help.c                | 134 ++-------
 tools/{perf => lib/api}/util/help.h                |   3 +
 tools/{perf => lib/api}/util/pager.c               |  14 +-
 tools/lib/api/util/pager.h                         |   7 +
 tools/{perf => lib/api}/util/parse-options.c       |  30 +-
 tools/{perf => lib/api}/util/parse-options.h       |  10 +-
 tools/{perf => lib/api}/util/run-command.c         |  12 +-
 tools/{perf => lib/api}/util/run-command.h         |  10 +-
 tools/{perf => lib/api}/util/sigchain.c            |   4 +-
 tools/{perf => lib/api}/util/sigchain.h            |   6 +-
 tools/{perf => lib/api}/util/strbuf.c              |   6 +-
 tools/{perf => lib/api}/util/strbuf.h              |   8 +-
 tools/lib/api/util/term.c                          |  36 +++
 tools/lib/api/util/term.h                          |   7 +
 tools/{perf => lib/api}/util/usage.c               |   4 +-
 tools/lib/api/util/usage.h                         |  23 ++
 tools/{perf => lib/api}/util/wrapper.c             |   4 +-
 .../{perf/util/cache.h => lib/api/util/wrapper.h}  |  65 +----
 tools/perf/Build                                   |   3 +-
 tools/perf/MANIFEST                                |   2 -
 tools/perf/Makefile.perf                           |  13 +-
 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                      |   3 +-
 tools/perf/builtin-bench.c                         |   2 +-
 tools/perf/builtin-buildid-cache.c                 |   4 +-
 tools/perf/builtin-buildid-list.c                  |   4 +-
 tools/perf/builtin-config.c                        |   3 +-
 tools/perf/builtin-data.c                          |   2 +-
 tools/perf/builtin-evlist.c                        |   2 +-
 tools/perf/builtin-help.c                          |  11 +-
 tools/perf/builtin-inject.c                        |   2 +-
 tools/perf/builtin-kmem.c                          |   5 +-
 tools/perf/builtin-kvm.c                           |   3 +-
 tools/perf/builtin-list.c                          |   4 +-
 tools/perf/builtin-lock.c                          |   3 +-
 tools/perf/builtin-mem.c                           |   2 +-
 tools/perf/builtin-probe.c                         |   2 +-
 tools/perf/builtin-record.c                        |   2 +-
 tools/perf/builtin-report.c                        |   3 +-
 tools/perf/builtin-sched.c                         |   3 +-
 tools/perf/builtin-script.c                        |  13 +-
 tools/perf/builtin-stat.c                          |   2 +-
 tools/perf/builtin-timechart.c                     |   3 +-
 tools/perf/builtin-top.c                           |   3 +-
 tools/perf/builtin-trace.c                         |   4 +-
 tools/perf/builtin-version.c                       |   9 +
 tools/perf/builtin.h                               |   2 +-
 tools/perf/config/Makefile                         |   4 +-
 tools/perf/perf.c                                  |  30 +-
 tools/perf/perf.h                                  |  13 +
 tools/perf/tests/Build                             |   6 +-
 tools/perf/tests/attr.c                            |   4 +-
 tools/perf/tests/bpf.c                             |   4 +-
 tools/perf/tests/builtin-test.c                    |   2 +-
 tools/perf/tests/llvm.c                            |   4 +-
 tools/perf/ui/browser.c                            |   1 -
 tools/perf/ui/browsers/header.c                    |   2 +-
 tools/perf/ui/gtk/browser.c                        |   2 +-
 tools/perf/ui/gtk/hists.c                          |   2 +-
 tools/perf/ui/gtk/setup.c                          |   2 +-
 tools/perf/ui/helpline.h                           |   2 +-
 tools/perf/ui/progress.c                           |   2 +-
 tools/perf/ui/setup.c                              |   7 +-
 tools/perf/ui/tui/progress.c                       |   2 +-
 tools/perf/ui/tui/setup.c                          |   1 -
 tools/perf/ui/tui/util.c                           |   1 -
 tools/perf/ui/ui.h                                 |   1 +
 tools/perf/util/Build                              |  20 +-
 tools/perf/util/alias.c                            |   2 +-
 tools/perf/util/alias.h                            |   7 +
 tools/perf/util/annotate.c                         |   1 -
 tools/perf/util/auxtrace.c                         |   4 +-
 tools/perf/util/bpf-loader.c                       |   2 +-
 tools/perf/util/cgroup.c                           |   2 +-
 tools/perf/util/color.c                            |   4 +-
 tools/perf/util/config.c                           |   3 +-
 tools/perf/util/config.h                           |  18 ++
 tools/perf/util/debug.c                            |   1 -
 tools/perf/util/env.c                              |   9 -
 tools/perf/util/environment.c                      |   8 -
 tools/perf/util/evlist.c                           |   2 +-
 tools/perf/util/header.c                           |   2 +-
 tools/perf/util/help-unknown-cmd.c                 | 103 +++++++
 tools/perf/util/help-unknown-cmd.h                 |   0
 tools/perf/util/intel-pt-decoder/insn.c            |   2 +-
 .../perf/util/intel-pt-decoder/intel-pt-decoder.c  |   1 -
 tools/perf/util/levenshtein.c                      |   2 +-
 tools/perf/util/llvm-utils.c                       |   1 -
 tools/perf/util/lzma.h                             |   8 +
 tools/perf/util/map.c                              |   2 +-
 tools/perf/util/ordered-events.c                   |   2 +-
 tools/perf/util/parse-branch-options.c             |   2 +-
 tools/perf/util/parse-events.c                     |   5 +-
 tools/perf/util/parse-regs-options.c               |   2 +-
 tools/perf/util/path.c                             |  20 +-
 tools/perf/util/path.h                             |  12 +
 tools/perf/util/probe-event.c                      |   1 -
 tools/perf/util/probe-file.c                       |   1 -
 tools/perf/util/python-ext-sources                 |   1 -
 tools/perf/util/quote.c                            |   2 +-
 tools/perf/util/sort.h                             |   3 +-
 tools/perf/util/srcline.h                          |  16 ++
 tools/perf/util/string.h                           |  34 +++
 tools/perf/util/thread.h                           |   4 +-
 tools/perf/util/util.c                             |  34 ---
 tools/perf/util/util.h                             | 314 ++-------------------
 tools/perf/util/zlib.h                             |   8 +
 134 files changed, 864 insertions(+), 765 deletions(-)
 create mode 100644 tools/lib/api/string/Build
 rename tools/lib/{ => api/string}/string.c (73%)
 rename tools/{include/linux => lib/api/string}/string.h (23%)
 create mode 100644 tools/lib/api/util/Build
 rename tools/{perf => lib/api}/util/abspath.c (90%)
 create mode 100644 tools/lib/api/util/abspath.h
 create mode 100644 tools/lib/api/util/cfg.c
 create mode 100644 tools/lib/api/util/cfg.h
 create mode 100644 tools/lib/api/util/compat-util.h
 rename tools/{perf => lib/api}/util/ctype.c (97%)
 create mode 100644 tools/lib/api/util/ctype.h
 rename tools/{perf => lib/api}/util/exec_cmd.c (72%)
 rename tools/{perf => lib/api}/util/exec_cmd.h (14%)
 rename tools/{perf => lib/api}/util/help.c (59%)
 rename tools/{perf => lib/api}/util/help.h (85%)
 rename tools/{perf => lib/api}/util/pager.c (88%)
 create mode 100644 tools/lib/api/util/pager.h
 rename tools/{perf => lib/api}/util/parse-options.c (97%)
 rename tools/{perf => lib/api}/util/parse-options.h (98%)
 rename tools/{perf => lib/api}/util/run-command.c (96%)
 rename tools/{perf => lib/api}/util/run-command.h (87%)
 rename tools/{perf => lib/api}/util/sigchain.c (93%)
 rename tools/{perf => lib/api}/util/sigchain.h (53%)
 rename tools/{perf => lib/api}/util/strbuf.c (97%)
 rename tools/{perf => lib/api}/util/strbuf.h (95%)
 create mode 100644 tools/lib/api/util/term.c
 create mode 100644 tools/lib/api/util/term.h
 rename tools/{perf => lib/api}/util/usage.c (97%)
 create mode 100644 tools/lib/api/util/usage.h
 rename tools/{perf => lib/api}/util/wrapper.c (92%)
 rename tools/{perf/util/cache.h => lib/api/util/wrapper.h} (22%)
 create mode 100644 tools/perf/builtin-version.c
 create mode 100644 tools/perf/util/alias.h
 create mode 100644 tools/perf/util/config.h
 delete mode 100644 tools/perf/util/environment.c
 create mode 100644 tools/perf/util/help-unknown-cmd.c
 create mode 100644 tools/perf/util/help-unknown-cmd.h
 create mode 100644 tools/perf/util/lzma.h
 create mode 100644 tools/perf/util/path.h
 create mode 100644 tools/perf/util/srcline.h
 create mode 100644 tools/perf/util/string.h
 create mode 100644 tools/perf/util/zlib.h

-- 
2.4.3


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

end of thread, other threads:[~2015-12-11 11:21 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-08  4:21 [PATCH v2 00/14] perf tools: Move perf subcommand framework into lib/tools Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 01/14] perf: Fix 'make clean' Josh Poimboeuf
2015-12-08 17:40   ` Jiri Olsa
2015-12-08 18:40     ` Jiri Olsa
2015-12-08 18:49       ` Josh Poimboeuf
2015-12-08 18:46     ` Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 02/14] perf: Use -iquote for local include paths Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 03/14] perf: Split up util.h Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 04/14] perf: Move term functions out of util.c Josh Poimboeuf
2015-12-09 15:53   ` Arnaldo Carvalho de Melo
2015-12-10  8:18   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 05/14] perf: Remove unused pager_use_color variable Josh Poimboeuf
2015-12-09 15:43   ` Arnaldo Carvalho de Melo
2015-12-10  8:18   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 06/14] perf: Split up cache.h Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 07/14] perf: Remove cache.h Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 08/14] perf: Save cmdline arguments earlier Josh Poimboeuf
2015-12-10  8:18   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 09/14] perf: Remove check for unused PERF_PAGER_IN_USE Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 10/14] perf: Move cmd_version() to builtin-version.c Josh Poimboeuf
2015-12-10  8:19   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 11/14] perf: Move help_unknown_cmd() to its own file Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 12/14] perf tools: Move strlcpy() to tools/lib/string.c Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 13/14] perf tools: Move tools/lib/string.c to libapi Josh Poimboeuf
2015-12-08  4:21 ` [PATCH v2 14/14] perf tools: Move subcommand framework and related utils " Josh Poimboeuf
2015-12-08 18:16   ` Jiri Olsa
2015-12-08 18:49     ` Josh Poimboeuf
2015-12-08 19:09       ` Arnaldo Carvalho de Melo
2015-12-08 19:17         ` Josh Poimboeuf
2015-12-08 19:40           ` Arnaldo Carvalho de Melo
2015-12-08 21:48             ` Josh Poimboeuf
2015-12-08 22:27               ` Arnaldo Carvalho de Melo
2015-12-08 23:07                 ` Josh Poimboeuf
2015-12-09  8:03                   ` Ingo Molnar
2015-12-09 12:33                     ` Josh Poimboeuf
2015-12-09 15:58                       ` Arnaldo Carvalho de Melo
2015-12-09 18:59                         ` Josh Poimboeuf
2015-12-10  1:40                           ` Namhyung Kim
2015-12-10 14:54                             ` Josh Poimboeuf
2015-12-10 21:35                               ` Josh Poimboeuf
2015-12-11 11:21                                 ` Arnaldo Carvalho de Melo
2015-12-10 12:55                           ` Arnaldo Carvalho de Melo
2015-12-10 15:15                             ` Josh Poimboeuf
2015-12-10  1:58   ` Namhyung Kim
2015-12-10  2:00 ` [PATCH v2 00/14] perf tools: Move perf subcommand framework into lib/tools Namhyung Kim
2015-12-10 15:11   ` Josh Poimboeuf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).