From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Adrian Hunter <adrian.hunter@intel.com>,
David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Wang Nan <wangnan0@huawei.com>
Subject: [PATCH 05/13] perf events parse: Rename parsing state struct to clearer name
Date: Mon, 21 Aug 2017 16:25:41 -0300 [thread overview]
Message-ID: <20170821192549.17251-6-acme@kernel.org> (raw)
In-Reply-To: <20170821192549.17251-1-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
Rename it from 'parse_events_evlist' to 'parse_events_state' to better
state that this is parsing state that has to be passed around.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-dursqtg2h2w98ztaa297u43x@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/tests/bpf.c | 2 +-
tools/perf/util/parse-events.c | 24 ++++++++++++------------
tools/perf/util/parse-events.h | 14 +++++++-------
tools/perf/util/parse-events.y | 22 +++++++++++-----------
4 files changed, 31 insertions(+), 31 deletions(-)
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c
index 4422ab636d30..45ad248e6ccd 100644
--- a/tools/perf/tests/bpf.c
+++ b/tools/perf/tests/bpf.c
@@ -124,7 +124,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
struct perf_evlist *evlist;
int i, ret = TEST_FAIL, err = 0, count = 0;
- struct parse_events_evlist parse_evlist;
+ struct parse_events_state parse_evlist;
struct parse_events_error parse_error;
bzero(&parse_error, sizeof(parse_error));
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 84e301073885..272eab7f5ac8 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -589,7 +589,7 @@ static int add_tracepoint_multi_sys(struct list_head *list, int *idx,
}
struct __add_bpf_event_param {
- struct parse_events_evlist *data;
+ struct parse_events_state *data;
struct list_head *list;
struct list_head *head_config;
};
@@ -599,7 +599,7 @@ static int add_bpf_event(const char *group, const char *event, int fd,
{
LIST_HEAD(new_evsels);
struct __add_bpf_event_param *param = _param;
- struct parse_events_evlist *evlist = param->data;
+ struct parse_events_state *parse_state = param->data;
struct list_head *list = param->list;
struct perf_evsel *pos;
int err;
@@ -607,8 +607,8 @@ static int add_bpf_event(const char *group, const char *event, int fd,
pr_debug("add bpf event %s:%s and attach bpf program %d\n",
group, event, fd);
- err = parse_events_add_tracepoint(&new_evsels, &evlist->idx, group,
- event, evlist->error,
+ err = parse_events_add_tracepoint(&new_evsels, &parse_state->idx, group,
+ event, parse_state->error,
param->head_config);
if (err) {
struct perf_evsel *evsel, *tmp;
@@ -632,7 +632,7 @@ static int add_bpf_event(const char *group, const char *event, int fd,
return 0;
}
-int parse_events_load_bpf_obj(struct parse_events_evlist *data,
+int parse_events_load_bpf_obj(struct parse_events_state *data,
struct list_head *list,
struct bpf_object *obj,
struct list_head *head_config)
@@ -686,7 +686,7 @@ int parse_events_load_bpf_obj(struct parse_events_evlist *data,
}
static int
-parse_events_config_bpf(struct parse_events_evlist *data,
+parse_events_config_bpf(struct parse_events_state *data,
struct bpf_object *obj,
struct list_head *head_config)
{
@@ -762,7 +762,7 @@ split_bpf_config_terms(struct list_head *evt_head_config,
list_move_tail(&term->list, obj_head_config);
}
-int parse_events_load_bpf(struct parse_events_evlist *data,
+int parse_events_load_bpf(struct parse_events_state *data,
struct list_head *list,
char *bpf_file_name,
bool source,
@@ -1184,7 +1184,7 @@ int parse_events_add_tracepoint(struct list_head *list, int *idx,
err, head_config);
}
-int parse_events_add_numeric(struct parse_events_evlist *data,
+int parse_events_add_numeric(struct parse_events_state *data,
struct list_head *list,
u32 type, u64 config,
struct list_head *head_config)
@@ -1209,7 +1209,7 @@ int parse_events_add_numeric(struct parse_events_evlist *data,
get_config_name(head_config), &config_terms);
}
-int parse_events_add_pmu(struct parse_events_evlist *data,
+int parse_events_add_pmu(struct parse_events_state *data,
struct list_head *list, char *name,
struct list_head *head_config)
{
@@ -1267,7 +1267,7 @@ int parse_events_add_pmu(struct parse_events_evlist *data,
return evsel ? 0 : -ENOMEM;
}
-int parse_events_multi_pmu_add(struct parse_events_evlist *data,
+int parse_events_multi_pmu_add(struct parse_events_state *data,
char *str, struct list_head **listp)
{
struct list_head *head;
@@ -1675,7 +1675,7 @@ int parse_events_terms(struct list_head *terms, const char *str)
int parse_events(struct perf_evlist *evlist, const char *str,
struct parse_events_error *err)
{
- struct parse_events_evlist data = {
+ struct parse_events_state data = {
.list = LIST_HEAD_INIT(data.list),
.idx = evlist->nr_entries,
.error = err,
@@ -2520,7 +2520,7 @@ void parse_events__clear_array(struct parse_events_array *a)
zfree(&a->ranges);
}
-void parse_events_evlist_error(struct parse_events_evlist *data,
+void parse_events_evlist_error(struct parse_events_state *data,
int idx, const char *str)
{
struct parse_events_error *err = data->error;
diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index a235f4d6d5e5..8fff8423469b 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -108,7 +108,7 @@ struct parse_events_error {
char *help; /* optional help string */
};
-struct parse_events_evlist {
+struct parse_events_state {
struct list_head list;
int idx;
int nr_groups;
@@ -143,18 +143,18 @@ int parse_events_add_tracepoint(struct list_head *list, int *idx,
const char *sys, const char *event,
struct parse_events_error *error,
struct list_head *head_config);
-int parse_events_load_bpf(struct parse_events_evlist *data,
+int parse_events_load_bpf(struct parse_events_state *data,
struct list_head *list,
char *bpf_file_name,
bool source,
struct list_head *head_config);
/* Provide this function for perf test */
struct bpf_object;
-int parse_events_load_bpf_obj(struct parse_events_evlist *data,
+int parse_events_load_bpf_obj(struct parse_events_state *data,
struct list_head *list,
struct bpf_object *obj,
struct list_head *head_config);
-int parse_events_add_numeric(struct parse_events_evlist *data,
+int parse_events_add_numeric(struct parse_events_state *data,
struct list_head *list,
u32 type, u64 config,
struct list_head *head_config);
@@ -164,11 +164,11 @@ int parse_events_add_cache(struct list_head *list, int *idx,
struct list_head *head_config);
int parse_events_add_breakpoint(struct list_head *list, int *idx,
void *ptr, char *type, u64 len);
-int parse_events_add_pmu(struct parse_events_evlist *data,
+int parse_events_add_pmu(struct parse_events_state *data,
struct list_head *list, char *name,
struct list_head *head_config);
-int parse_events_multi_pmu_add(struct parse_events_evlist *data,
+int parse_events_multi_pmu_add(struct parse_events_state *data,
char *str,
struct list_head **listp);
@@ -180,7 +180,7 @@ perf_pmu__parse_check(const char *name);
void parse_events__set_leader(char *name, struct list_head *list);
void parse_events_update_lists(struct list_head *list_event,
struct list_head *list_all);
-void parse_events_evlist_error(struct parse_events_evlist *data,
+void parse_events_evlist_error(struct parse_events_state *data,
int idx, const char *str);
void print_events(const char *event_glob, bool name_only, bool quiet,
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y
index 96c0fa59aa8f..403a221266b8 100644
--- a/tools/perf/util/parse-events.y
+++ b/tools/perf/util/parse-events.y
@@ -33,7 +33,7 @@ do { \
} while (0)
static void inc_group_count(struct list_head *list,
- struct parse_events_evlist *data)
+ struct parse_events_state *data)
{
/* Count groups only have more than 1 members */
if (!list_is_last(list->next, list))
@@ -115,7 +115,7 @@ PE_START_TERMS start_terms
start_events: groups
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
parse_events_update_lists($1, &data->list);
}
@@ -309,7 +309,7 @@ value_sym sep_slash_dc
event_legacy_cache:
PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT opt_event_config
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct parse_events_error *error = data->error;
struct list_head *list;
@@ -321,7 +321,7 @@ PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT '-' PE_NAME_CACHE_OP_RESULT opt_e
|
PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT opt_event_config
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct parse_events_error *error = data->error;
struct list_head *list;
@@ -333,7 +333,7 @@ PE_NAME_CACHE_TYPE '-' PE_NAME_CACHE_OP_RESULT opt_event_config
|
PE_NAME_CACHE_TYPE opt_event_config
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct parse_events_error *error = data->error;
struct list_head *list;
@@ -346,7 +346,7 @@ PE_NAME_CACHE_TYPE opt_event_config
event_legacy_mem:
PE_PREFIX_MEM PE_VALUE '/' PE_VALUE ':' PE_MODIFIER_BP sep_dc
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct list_head *list;
ALLOC_LIST(list);
@@ -357,7 +357,7 @@ PE_PREFIX_MEM PE_VALUE '/' PE_VALUE ':' PE_MODIFIER_BP sep_dc
|
PE_PREFIX_MEM PE_VALUE '/' PE_VALUE sep_dc
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct list_head *list;
ALLOC_LIST(list);
@@ -368,7 +368,7 @@ PE_PREFIX_MEM PE_VALUE '/' PE_VALUE sep_dc
|
PE_PREFIX_MEM PE_VALUE ':' PE_MODIFIER_BP sep_dc
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct list_head *list;
ALLOC_LIST(list);
@@ -379,7 +379,7 @@ PE_PREFIX_MEM PE_VALUE ':' PE_MODIFIER_BP sep_dc
|
PE_PREFIX_MEM PE_VALUE sep_dc
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct list_head *list;
ALLOC_LIST(list);
@@ -391,7 +391,7 @@ PE_PREFIX_MEM PE_VALUE sep_dc
event_legacy_tracepoint:
tracepoint_name opt_event_config
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct parse_events_error *error = data->error;
struct list_head *list;
@@ -451,7 +451,7 @@ PE_RAW opt_event_config
event_bpf_file:
PE_BPF_OBJECT opt_event_config
{
- struct parse_events_evlist *data = _data;
+ struct parse_events_state *data = _data;
struct parse_events_error *error = data->error;
struct list_head *list;
--
2.13.5
next prev parent reply other threads:[~2017-08-21 19:25 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-21 19:25 [GIT PULL 00/13] perf/core improvements and fixes Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 01/13] tools lib bpf: Fix double file test in Makefile Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 02/13] perf jevents: Support FCMask and PortMask Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 03/13] perf trace: Fix off by one string allocation problem Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 04/13] perf events parse: Remove some needless local variables Arnaldo Carvalho de Melo
2017-08-21 19:25 ` Arnaldo Carvalho de Melo [this message]
2017-08-21 19:25 ` [PATCH 06/13] perf events parse: Use just one parse events state struct Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 07/13] perf events parse: Rename parse_events_parse arguments Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 08/13] perf tools: Remove unused cpu_relax() macros Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 09/13] perf tools: Use default CPUINFO_PROC where it fits Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 10/13] perf annotate stdio: Support --show-nr-samples option Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 11/13] perf annotate: Document --show-total-period option Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 12/13] perf annotate browser: Support --show-nr-samples option Arnaldo Carvalho de Melo
2017-08-21 19:25 ` [PATCH 13/13] perf annotate browser: Circulate percent, total-period and nr-samples view Arnaldo Carvalho de Melo
2017-08-22 10:20 ` [GIT PULL 00/13] perf/core improvements and fixes Ingo Molnar
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=20170821192549.17251-6-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.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 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.