Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1405909

[RFC][PATCH v2 0/5] perf config: Reimplement perf_config() using perf_config_set__inter()

From Taeung Song <treeze.taeung@gmail.com>
Newsgroups linux.kernel
Subject [RFC][PATCH v2 0/5] perf config: Reimplement perf_config() using perf_config_set__inter()
Date 2016-05-24 09:20 +0200
Message-ID <rCeNb-dQ-9@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


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, what old perf_config() handle is the same as new perf_config() work
without the repetitive work that read 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.

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

Thanks,
Taeung

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 (5):
  perf config: Use new perf_config_set__init() to initialize config set
  perf config: Reimplement perf_config() using perf_config_set__iter()
  perf config: Modify perf_config_set__delete() using global variable
    'config_set'
  perf config: Reimplement show_config() using perf_config()
  perf config: Reset config set at only 'config' sub-command

 tools/perf/builtin-config.c |  43 ++++--------
 tools/perf/util/config.c    | 156 +++++++++++++++++++++++++++++---------------
 tools/perf/util/config.h    |   2 +-
 3 files changed, 117 insertions(+), 84 deletions(-)

-- 
2.5.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[RFC][PATCH v2 0/5] perf config: Reimplement perf_config() using perf_config_set__inter() Taeung Song <treeze.taeung@gmail.com> - 2016-05-24 09:20 +0200

csiph-web