Skip to content

Commit 00f4b65

Browse files
jlintonarmrostedt
authored andcommitted
trace: rename trace_enum_map to trace_eval_map
Each enum is loaded into the trace_enum_map, as we are now using this for more than enums rename it. Link: http://lkml.kernel.org/r/20170531215653.3240-3-jeremy.linton@arm.com Signed-off-by: Jeremy Linton <jeremy.linton@arm.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 02fd7f6 commit 00f4b65

6 files changed

Lines changed: 29 additions & 29 deletions

File tree

‎include/linux/module.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ struct module {
442442
#ifdef CONFIG_EVENT_TRACING
443443
struct trace_event_call **trace_events;
444444
unsigned int num_trace_events;
445-
struct trace_enum_map **trace_enums;
445+
struct trace_eval_map **trace_enums;
446446
unsigned int num_trace_enums;
447447
#endif
448448
#ifdef CONFIG_FTRACE_MCOUNT_RECORD

‎include/linux/tracepoint.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ struct module;
2525
struct tracepoint;
2626
struct notifier_block;
2727

28-
struct trace_enum_map {
28+
struct trace_eval_map {
2929
const char *system;
30-
const char *enum_string;
31-
unsigned long enum_value;
30+
const char *eval_string;
31+
unsigned long eval_value;
3232
};
3333

3434
#define TRACEPOINT_DEFAULT_PRIO 10

‎include/trace/trace_events.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ TRACE_MAKE_SYSTEM_STR();
3535

3636
#undef TRACE_DEFINE_ENUM
3737
#define TRACE_DEFINE_ENUM(a) \
38-
static struct trace_enum_map __used __initdata \
38+
static struct trace_eval_map __used __initdata \
3939
__##TRACE_SYSTEM##_##a = \
4040
{ \
4141
.system = TRACE_SYSTEM_STRING, \
42-
.enum_string = #a, \
43-
.enum_value = a \
42+
.eval_string = #a, \
43+
.eval_value = a \
4444
}; \
45-
static struct trace_enum_map __used \
45+
static struct trace_eval_map __used \
4646
__attribute__((section("_ftrace_eval_map"))) \
4747
*TRACE_SYSTEM##_##a = &__##TRACE_SYSTEM##_##a
4848

‎kernel/trace/trace.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ union trace_enum_map_item;
132132
struct trace_enum_map_tail {
133133
/*
134134
* "end" is first and points to NULL as it must be different
135-
* than "mod" or "enum_string"
135+
* than "mod" or "eval_string"
136136
*/
137137
union trace_enum_map_item *next;
138138
const char *end; /* points to NULL */
@@ -148,7 +148,7 @@ static DEFINE_MUTEX(trace_enum_mutex);
148148
* pointer to the next array of saved enum_map items.
149149
*/
150150
union trace_enum_map_item {
151-
struct trace_enum_map map;
151+
struct trace_eval_map map;
152152
struct trace_enum_map_head head;
153153
struct trace_enum_map_tail tail;
154154
};
@@ -4748,7 +4748,7 @@ static const struct file_operations tracing_saved_cmdlines_size_fops = {
47484748
static union trace_enum_map_item *
47494749
update_enum_map(union trace_enum_map_item *ptr)
47504750
{
4751-
if (!ptr->map.enum_string) {
4751+
if (!ptr->map.eval_string) {
47524752
if (ptr->tail.next) {
47534753
ptr = ptr->tail.next;
47544754
/* Set ptr to the next real item (skip head) */
@@ -4808,7 +4808,7 @@ static int enum_map_show(struct seq_file *m, void *v)
48084808
union trace_enum_map_item *ptr = v;
48094809

48104810
seq_printf(m, "%s %ld (%s)\n",
4811-
ptr->map.enum_string, ptr->map.enum_value,
4811+
ptr->map.eval_string, ptr->map.eval_value,
48124812
ptr->map.system);
48134813

48144814
return 0;
@@ -4844,11 +4844,11 @@ trace_enum_jmp_to_tail(union trace_enum_map_item *ptr)
48444844
}
48454845

48464846
static void
4847-
trace_insert_enum_map_file(struct module *mod, struct trace_enum_map **start,
4847+
trace_insert_enum_map_file(struct module *mod, struct trace_eval_map **start,
48484848
int len)
48494849
{
4850-
struct trace_enum_map **stop;
4851-
struct trace_enum_map **map;
4850+
struct trace_eval_map **stop;
4851+
struct trace_eval_map **map;
48524852
union trace_enum_map_item *map_array;
48534853
union trace_enum_map_item *ptr;
48544854

@@ -4902,13 +4902,13 @@ static void trace_create_enum_file(struct dentry *d_tracer)
49024902
#else /* CONFIG_TRACE_ENUM_MAP_FILE */
49034903
static inline void trace_create_enum_file(struct dentry *d_tracer) { }
49044904
static inline void trace_insert_enum_map_file(struct module *mod,
4905-
struct trace_enum_map **start, int len) { }
4905+
struct trace_eval_map **start, int len) { }
49064906
#endif /* !CONFIG_TRACE_ENUM_MAP_FILE */
49074907

49084908
static void trace_insert_enum_map(struct module *mod,
4909-
struct trace_enum_map **start, int len)
4909+
struct trace_eval_map **start, int len)
49104910
{
4911-
struct trace_enum_map **map;
4911+
struct trace_eval_map **map;
49124912

49134913
if (len <= 0)
49144914
return;
@@ -7732,8 +7732,8 @@ struct dentry *tracing_init_dentry(void)
77327732
return NULL;
77337733
}
77347734

7735-
extern struct trace_enum_map *__start_ftrace_eval_maps[];
7736-
extern struct trace_enum_map *__stop_ftrace_eval_maps[];
7735+
extern struct trace_eval_map *__start_ftrace_eval_maps[];
7736+
extern struct trace_eval_map *__stop_ftrace_eval_maps[];
77377737

77387738
static void __init trace_enum_init(void)
77397739
{

‎kernel/trace/trace.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,10 +1773,10 @@ static inline const char *get_syscall_name(int syscall)
17731773

17741774
#ifdef CONFIG_EVENT_TRACING
17751775
void trace_event_init(void);
1776-
void trace_event_enum_update(struct trace_enum_map **map, int len);
1776+
void trace_event_enum_update(struct trace_eval_map **map, int len);
17771777
#else
17781778
static inline void __init trace_event_init(void) { }
1779-
static inline void trace_event_enum_update(struct trace_enum_map **map, int len) { }
1779+
static inline void trace_event_enum_update(struct trace_eval_map **map, int len) { }
17801780
#endif
17811781

17821782
extern struct trace_iterator *tracepoint_print_iter;

‎kernel/trace/trace_events.c‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,18 +2067,18 @@ __register_event(struct trace_event_call *call, struct module *mod)
20672067
return 0;
20682068
}
20692069

2070-
static char *enum_replace(char *ptr, struct trace_enum_map *map, int len)
2070+
static char *enum_replace(char *ptr, struct trace_eval_map *map, int len)
20712071
{
20722072
int rlen;
20732073
int elen;
20742074

20752075
/* Find the length of the enum value as a string */
2076-
elen = snprintf(ptr, 0, "%ld", map->enum_value);
2076+
elen = snprintf(ptr, 0, "%ld", map->eval_value);
20772077
/* Make sure there's enough room to replace the string with the value */
20782078
if (len < elen)
20792079
return NULL;
20802080

2081-
snprintf(ptr, elen + 1, "%ld", map->enum_value);
2081+
snprintf(ptr, elen + 1, "%ld", map->eval_value);
20822082

20832083
/* Get the rest of the string of ptr */
20842084
rlen = strlen(ptr + len);
@@ -2090,11 +2090,11 @@ static char *enum_replace(char *ptr, struct trace_enum_map *map, int len)
20902090
}
20912091

20922092
static void update_event_printk(struct trace_event_call *call,
2093-
struct trace_enum_map *map)
2093+
struct trace_eval_map *map)
20942094
{
20952095
char *ptr;
20962096
int quote = 0;
2097-
int len = strlen(map->enum_string);
2097+
int len = strlen(map->eval_string);
20982098

20992099
for (ptr = call->print_fmt; *ptr; ptr++) {
21002100
if (*ptr == '\\') {
@@ -2125,7 +2125,7 @@ static void update_event_printk(struct trace_event_call *call,
21252125
continue;
21262126
}
21272127
if (isalpha(*ptr) || *ptr == '_') {
2128-
if (strncmp(map->enum_string, ptr, len) == 0 &&
2128+
if (strncmp(map->eval_string, ptr, len) == 0 &&
21292129
!isalnum(ptr[len]) && ptr[len] != '_') {
21302130
ptr = enum_replace(ptr, map, len);
21312131
/* Hmm, enum string smaller than value */
@@ -2165,7 +2165,7 @@ static void update_event_printk(struct trace_event_call *call,
21652165
}
21662166
}
21672167

2168-
void trace_event_enum_update(struct trace_enum_map **map, int len)
2168+
void trace_event_enum_update(struct trace_eval_map **map, int len)
21692169
{
21702170
struct trace_event_call *call, *p;
21712171
const char *last_system = NULL;

0 commit comments

Comments
 (0)