Commit 67ec0d85 authored by Jeremy Linton's avatar Jeremy Linton Committed by Steven Rostedt (VMware)

tracing: Rename enum_replace to eval_replace

The enum_replace stanza works as is for sizeof()
calls as well as enums. Rename it as well.

Link: http://lkml.kernel.org/r/20170531215653.3240-9-jeremy.linton@arm.comSigned-off-by: default avatarJeremy Linton <jeremy.linton@arm.com>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent f57a4143
...@@ -2067,12 +2067,12 @@ __register_event(struct trace_event_call *call, struct module *mod) ...@@ -2067,12 +2067,12 @@ __register_event(struct trace_event_call *call, struct module *mod)
return 0; return 0;
} }
static char *enum_replace(char *ptr, struct trace_eval_map *map, int len) static char *eval_replace(char *ptr, struct trace_eval_map *map, int len)
{ {
int rlen; int rlen;
int elen; int elen;
/* Find the length of the enum value as a string */ /* Find the length of the eval value as a string */
elen = snprintf(ptr, 0, "%ld", map->eval_value); elen = snprintf(ptr, 0, "%ld", map->eval_value);
/* Make sure there's enough room to replace the string with the value */ /* Make sure there's enough room to replace the string with the value */
if (len < elen) if (len < elen)
...@@ -2127,14 +2127,14 @@ static void update_event_printk(struct trace_event_call *call, ...@@ -2127,14 +2127,14 @@ static void update_event_printk(struct trace_event_call *call,
if (isalpha(*ptr) || *ptr == '_') { if (isalpha(*ptr) || *ptr == '_') {
if (strncmp(map->eval_string, ptr, len) == 0 && if (strncmp(map->eval_string, ptr, len) == 0 &&
!isalnum(ptr[len]) && ptr[len] != '_') { !isalnum(ptr[len]) && ptr[len] != '_') {
ptr = enum_replace(ptr, map, len); ptr = eval_replace(ptr, map, len);
/* Hmm, enum string smaller than value */ /* enum/sizeof string smaller than value */
if (WARN_ON_ONCE(!ptr)) if (WARN_ON_ONCE(!ptr))
return; return;
/* /*
* No need to decrement here, as enum_replace() * No need to decrement here, as eval_replace()
* returns the pointer to the character passed * returns the pointer to the character passed
* the enum, and two enums can not be placed * the eval, and two evals can not be placed
* back to back without something in between. * back to back without something in between.
* We can skip that something in between. * We can skip that something in between.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment