linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH v5 0/9] perf config: Reimplement perf_config() using perf_config_set__inter()
@ 2016-05-31 17:26 Taeung Song
  2016-05-31 17:26 ` [BUGFIX][PATCH v5 1/9] perf config: Let perf_config() return in case of failure Taeung Song
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Taeung Song @ 2016-05-31 17:26 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: linux-kernel, Jiri Olsa, Namhyung Kim, Ingo Molnar,
	Peter Zijlstra, Alexander Shishkin, Masami Hiramatsu,
	Taeung Song

Hello, :)

This patchset is to reimplement perf_config() for efficient config management.

Everytime perf_config() is called, perf_config() always read config files.
(i.e. user config '~/.perfconfig' and system config '$(sysconfdir)/perfconfig')

But we need to use 'struct perf_config_set config_set' variable
that already contains all config key-value pairs
to avoid this repetitive work in perf_config().

In other words, if new perf_config() is called,
only first time 'config_set' is initialized
collecting all configs from config files and it work with perf_config_set__iter().

If we do, 'config_set' can be reused wherever using perf_config()
and a feature of old perf_config() is the same as new perf_config()
work without the repetitive work that read the config files.

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.

Most important patch of this patchset is "[PATCH v5 7/9] perf config: Reimplement
perf_config() using perf_config_set__iter()" and PATCH 1/9 ~ 6/9 are preparation for it.

If you give me any feedback, I'd apprecicated it. :)

Thanks,
Taeung

v5:
- solve a leak when perf_config_set__init() failed (Arnaldo)
- bugfix) let perf_config() return in case of failure
- bugfix) finally free the config set after collect_config() worked
- bugfix) 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 (9):
  perf config: Let perf_config() return in case of failure
  perf config: Finally free a config set after collect_config() worked
  perf config: Handle an error when config set is NULL at
    collect_config()
  perf config: Use new perf_config_set__init() to initialize config set
  perf config: Add global variable 'config_set'
  perf config: Use zfree() instead of free() at
    perf_config_set__delete()
  perf config: Reimplement perf_config() using perf_config_set__iter()
  perf config: Reset the config set at only 'config' sub-command
  perf config: Reimplement show_config() using perf_config()

 tools/perf/builtin-config.c |  41 +++++-------
 tools/perf/perf.c           |   1 +
 tools/perf/util/cache.h     |   1 +
 tools/perf/util/config.c    | 156 ++++++++++++++++++++++++++++----------------
 tools/perf/util/config.h    |   4 +-
 5 files changed, 121 insertions(+), 82 deletions(-)

-- 
2.5.0

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

end of thread, other threads:[~2016-05-31 17:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-31 17:26 [RFC][PATCH v5 0/9] perf config: Reimplement perf_config() using perf_config_set__inter() Taeung Song
2016-05-31 17:26 ` [BUGFIX][PATCH v5 1/9] perf config: Let perf_config() return in case of failure Taeung Song
2016-05-31 17:26 ` [BUGFIX][PATCH v5 2/9] perf config: Finally free a config set after collect_config() worked Taeung Song
2016-05-31 17:26 ` [BUGFIX][PATCH v5 3/9] perf config: Handle an error when config set is NULL at collect_config() Taeung Song
2016-05-31 17:26 ` [PATCH v5 4/9] perf config: Use new perf_config_set__init() to initialize config set Taeung Song
2016-05-31 17:26 ` [PATCH v5 5/9] perf config: Add global variable 'config_set' Taeung Song
2016-05-31 17:26 ` [PATCH v5 6/9] perf config: Use zfree() instead of free() at perf_config_set__delete() Taeung Song
2016-05-31 17:26 ` [PATCH v5 7/9] perf config: Reimplement perf_config() using perf_config_set__iter() Taeung Song
2016-05-31 17:26 ` [PATCH v5 8/9] perf config: Reset the config set at only 'config' sub-command Taeung Song
2016-05-31 17:26 ` [PATCH v5 9/9] perf config: Reimplement show_config() using perf_config() Taeung Song

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).