[PATCH 18/21] perf tools: Rename term related parsing function/variable properly

From: Jiri Olsa
Date: Wed Sep 25 2013 - 08:53:00 EST


The config_attr_term name is more suitable for the function
as it configures perf_event_attr data using term.

Using more suitable name 'terms' for list head of terms,
instead of list 'head_config' name.

Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
Cc: Corey Ashford <cjashfor@xxxxxxxxxxxxxxxxxx>
Cc: Frederic Weisbecker <fweisbec@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Cc: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
---
tools/perf/util/parse-events.c | 22 +++++++++++-----------
tools/perf/util/parse-events.h | 4 ++--
2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 37b9cb7..899c59e 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -540,8 +540,8 @@ int parse_events_add_breakpoint(struct list_head *list, int *idx,
return add_event(list, idx, &attr, NULL);
}

-static int config_term(struct perf_event_attr *attr,
- struct parse_events_term *term)
+static int config_attr_term(struct perf_event_attr *attr,
+ struct parse_events_term *term)
{
#define CHECK_TYPE_VAL(type) \
do { \
@@ -608,7 +608,7 @@ static int config_attr(struct perf_event_attr *attr,
struct parse_events_term *term;

list_for_each_entry(term, head, list)
- if (config_term(attr, term) && fail)
+ if (config_attr_term(attr, term) && fail)
return -EINVAL;

return 0;
@@ -616,7 +616,7 @@ static int config_attr(struct perf_event_attr *attr,

int parse_events_add_numeric(struct list_head *list, int *idx,
u32 type, u64 config,
- struct list_head *head_config)
+ struct list_head *terms)
{
struct perf_event_attr attr;

@@ -624,15 +624,15 @@ int parse_events_add_numeric(struct list_head *list, int *idx,
attr.type = type;
attr.config = config;

- if (head_config &&
- config_attr(&attr, head_config, 1))
+ if (terms &&
+ config_attr(&attr, terms, 1))
return -EINVAL;

return add_event(list, idx, &attr, pmu_event_name(terms));
}

int parse_events_add_pmu(struct list_head *list, int *idx,
- char *name, struct list_head *head_config)
+ char *name, struct list_head *terms)
{
struct perf_event_attr attr;
struct perf_pmu *pmu;
@@ -643,19 +643,19 @@ int parse_events_add_pmu(struct list_head *list, int *idx,

memset(&attr, 0, sizeof(attr));

- if (perf_pmu__check_alias(pmu, head_config))
+ if (perf_pmu__check_alias(pmu, terms))
return -EINVAL;

/*
* Configure hardcoded terms first, no need to check
* return value when called with fail == 0 ;)
*/
- config_attr(&attr, head_config, 0);
+ config_attr(&attr, terms, 0);

- if (perf_pmu__config(pmu, &attr, head_config))
+ if (perf_pmu__config(pmu, &attr, terms))
return -EINVAL;

- return __add_event(list, idx, &attr, pmu_event_name(head_config),
+ return __add_event(list, idx, &attr, pmu_event_name(terms),
pmu->cpus);
}

diff --git a/tools/perf/util/parse-events.h b/tools/perf/util/parse-events.h
index f1cb4c4..a9db24f 100644
--- a/tools/perf/util/parse-events.h
+++ b/tools/perf/util/parse-events.h
@@ -89,13 +89,13 @@ int parse_events_add_tracepoint(struct list_head *list, int *idx,
char *sys, char *event);
int parse_events_add_numeric(struct list_head *list, int *idx,
u32 type, u64 config,
- struct list_head *head_config);
+ struct list_head *terms);
int parse_events_add_cache(struct list_head *list, int *idx,
char *type, char *op_result1, char *op_result2);
int parse_events_add_breakpoint(struct list_head *list, int *idx,
void *ptr, char *type);
int parse_events_add_pmu(struct list_head *list, int *idx,
- char *pmu , struct list_head *head_config);
+ char *pmu , struct list_head *terms);
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);
--
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/