From: Taeung Song <treeze.taeung@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-kernel@vger.kernel.org, Jiri Olsa <jolsa@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Masami Hiramatsu <mhiramat@kernel.org>,
Wang Nan <wangnan0@huawei.com>,
Taeung Song <treeze.taeung@gmail.com>
Subject: [PATCH v10 0/3] perf config: Reimplement perf_config()
Date: Thu, 23 Jun 2016 17:55:16 +0900 [thread overview]
Message-ID: <1466672119-4852-1-git-send-email-treeze.taeung@gmail.com> (raw)
Hello, :)
This patchset is to reimplement perf_config() for efficient config management.
Many sub-commands use perf_config() but
everytime perf_config() is called, perf_config() always read config files.
(i.e. user config '~/.perfconfig' and system config '$(sysconfdir)/perfconfig')
But it is better to use the config set that already contains all config
key-value pairs to avoid this repetitive work reading the config files
in perf_config().
In summary, in order to use features about configuration,
we can call the functions at perf.c and other source files as below.
# initialize a config set
perf_config_init()
# configure actual variables from a config set
perf_config()
# eliminate allocated config set
perf_config_finish()
# destroy existing config set and initialize a new config set.
perf_config_refresh()
IMHO, I think this patchset is needed because not only the repetitive work
should be avoided but also in near future, it would be smooth to manage perf configs.
If you give me any feedback, I'd apprecicated it. :)
Thanks,
Taeung
v10:
- rebased onto current acme/perf/core
v9:
- add config_set__for_each macro (Arnaldo)
- the source files that only need config.h don't include cache.h (Arnaldo)
- use 'config_set' as a static variable instead of a global variable. (Namhyung)
- add perf_config_init(), perf_config_finish() and perf_config_refresh() (Namhyung)
- remove [PATCH v8 4/5] perf config: Use zfree() instead of free() at perf_config_set__delete()
- rebased onto current acme/perf/core
- applied ([BUGFIX][PATCH v8 1/5] 826424)
v8:
- handle the error about NULL at perf_config_set__delete()
- bring declarations about config from util/config.h to util/config.h
- reimplement show_config() using perf_config_set__iter() instead of perf_config()
- rebased onto perf-core-for-mingo-20160607
- applied ([PATCH v7 1/7] 25d8f48, [PATCH v7 2/7] 8beeb00)
v7:
- fill a missing crumb that assign NULL to 'set' variable in perf_config_set__new()
(Arnaldo)
- two patches applied ([PATCH v6 1/9] 78f71c9, [PATCH v6 3/9] 7db91f2)
v6:
- add printing error message when perf_config_set__iter() is failed
- modify commit messages for bugfix 1~3 (PATCH 1/9 ~ 3/9)
to help reviewers easily understand why them is needed
v5:
- solve the leak when perf_config_set__init() failed (Arnaldo)
(to clear the problem it is needed to apply the bottom bugfix 1~3 patches)
- bugfix 1) fix the problem of abnormal terminaltion at perf_parse_file() called by perf_config()
- bugfix 2) if failed at collect_config(), finally free a config set
after it is done instead of freeing the config set in the function
- bugfix 3) handle NULL pointer exception of 'set' at collect_config()
v4:
- Keep perf_config_set__delete() as it is (Arnaldo)
- Remove perf_config_set__check() (Arnaldo)
- Keep the existing code about the config set at cmd_config() (Arnaldo)
v3:
- add freeing config set after sub-command work at run_builtin() (Namhyung)
- remove needless code about the config set at cmd_config()
- add a patch about a global variable 'config_set'
v2:
- split a patch into several patches
- reimplement show_config() using new perf_config()
- modify perf_config_set__delete using global variable 'config_set'
- reset config set when only 'config' sub-commaned work
because of options for config file location
Taeung Song (3):
perf config: Bring declarations about config from util/cache.h to
util/config.h
perf config: Reimplement perf_config() introducing new
perf_config_init() and perf_config_finish()
perf config: Reimplement show_config() using config_set__for_each
tools/perf/builtin-config.c | 21 ++++-----
tools/perf/builtin-help.c | 2 +-
tools/perf/builtin-kmem.c | 2 +-
tools/perf/builtin-record.c | 1 +
tools/perf/builtin-report.c | 2 +-
tools/perf/builtin-top.c | 2 +-
tools/perf/perf.c | 4 +-
tools/perf/ui/browser.c | 2 +-
tools/perf/ui/browsers/annotate.c | 1 +
tools/perf/util/alias.c | 1 +
tools/perf/util/cache.h | 11 -----
tools/perf/util/color.c | 1 +
tools/perf/util/config.c | 92 +++++++++++++++++++-------------------
tools/perf/util/config.h | 40 +++++++++++++++++
tools/perf/util/help-unknown-cmd.c | 1 +
tools/perf/util/intel-pt.c | 1 +
tools/perf/util/llvm-utils.c | 1 +
17 files changed, 111 insertions(+), 74 deletions(-)
--
2.5.0
next reply other threads:[~2016-06-23 8:55 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-23 8:55 Taeung Song [this message]
2016-06-23 8:55 ` [PATCH v10 1/3] perf config: Bring declarations about config from util/cache.h to util/config.h Taeung Song
2016-06-23 11:57 ` Arnaldo Carvalho de Melo
2016-06-23 12:42 ` Taeung Song
2016-06-26 10:55 ` [tip:perf/core] perf config: Move config declarations " tip-bot for Taeung Song
2016-06-23 8:55 ` [PATCH v10 2/3] perf config: Reimplement perf_config() introducing new perf_config_init() and perf_config_finish() Taeung Song
2016-06-23 11:56 ` Arnaldo Carvalho de Melo
2016-06-23 12:41 ` Taeung Song
2016-06-23 8:55 ` [PATCH v10 3/3] perf config: Reimplement show_config() using config_set__for_each Taeung Song
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=1466672119-4852-1-git-send-email-treeze.taeung@gmail.com \
--to=treeze.taeung@gmail.com \
--cc=acme@kernel.org \
--cc=alexander.shishkin@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mhiramat@kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=wangnan0@huawei.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®