All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Poimboeuf <jpoimboe@redhat.com>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 00/13] perf tools: Move perf subcommand framework into lib/tools
Date: Fri,  4 Dec 2015 15:59:11 -0600	[thread overview]
Message-ID: <cover.1449265570.git.jpoimboe@redhat.com> (raw)

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-10 do some cleanups and splitting up of the code in
preparation for the move.

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

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

Josh Poimboeuf (13):
  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 perf subcommand framework into a library
  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       |   7 +-
 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/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 +
 133 files changed, 852 insertions(+), 761 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


             reply	other threads:[~2015-12-04 21:59 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-04 21:59 Josh Poimboeuf [this message]
2015-12-04 21:59 ` [PATCH 01/13] perf: Use -iquote for local include paths Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 02/13] perf: Split up util.h Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 03/13] perf: Move term functions out of util.c Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 04/13] perf: Remove unused pager_use_color variable Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 05/13] perf: Split up cache.h Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 06/13] perf: Remove cache.h Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 07/13] perf: Save cmdline arguments earlier Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 08/13] perf: Remove check for unused PERF_PAGER_IN_USE Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 09/13] perf: Move cmd_version() to builtin-version.c Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 10/13] perf: Move help_unknown_cmd() to its own file Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 11/13] perf tools: Move strlcpy() to tools/lib/string.c Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 12/13] perf tools: Move perf subcommand framework into a library Josh Poimboeuf
2015-12-04 22:21   ` [PATCH 12/13 v1.1] perf tools: Move tools/lib/string.c to libapi Josh Poimboeuf
2015-12-04 21:59 ` [PATCH 13/13] perf tools: Move subcommand framework and related utils " Josh Poimboeuf
2015-12-06  9:37 ` [PATCH 00/13] perf tools: Move perf subcommand framework into lib/tools Ingo Molnar
2015-12-06 15:50   ` Jiri Olsa
2015-12-06 20:02     ` Josh Poimboeuf
2015-12-07  8:46       ` Jiri Olsa
2015-12-08 14:52         ` Arnaldo Carvalho de Melo
2015-12-08 14:55           ` Arnaldo Carvalho de Melo
2015-12-08 15:27             ` Josh Poimboeuf
2015-12-08 15:29             ` Arnaldo Carvalho de Melo
2015-12-08 15:41               ` Arnaldo Carvalho de Melo
2015-12-06 18:28   ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1449265570.git.jpoimboe@redhat.com \
    --to=jpoimboe@redhat.com \
    --cc=acme@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.