Skip to content

Commit 2ece94f

Browse files
tzanussirostedt
authored andcommitted
tracing: Move get_hist_field_flags()
Move get_hist_field_flags() to make it more easily accessible for new code (and keep the move separate from new functionality). Link: http://lkml.kernel.org/r/32470f0a7047ec7a6e84ba5ec89d6142cc6ede7d.1516069914.git.tom.zanussi@linux.intel.com Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
1 parent 1a361df commit 2ece94f

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

kernel/trace/trace_events_hist.c

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,28 @@ static const struct tracing_map_ops hist_trigger_elt_comm_ops = {
497497
.elt_init = hist_trigger_elt_comm_init,
498498
};
499499

500+
static const char *get_hist_field_flags(struct hist_field *hist_field)
501+
{
502+
const char *flags_str = NULL;
503+
504+
if (hist_field->flags & HIST_FIELD_FL_HEX)
505+
flags_str = "hex";
506+
else if (hist_field->flags & HIST_FIELD_FL_SYM)
507+
flags_str = "sym";
508+
else if (hist_field->flags & HIST_FIELD_FL_SYM_OFFSET)
509+
flags_str = "sym-offset";
510+
else if (hist_field->flags & HIST_FIELD_FL_EXECNAME)
511+
flags_str = "execname";
512+
else if (hist_field->flags & HIST_FIELD_FL_SYSCALL)
513+
flags_str = "syscall";
514+
else if (hist_field->flags & HIST_FIELD_FL_LOG2)
515+
flags_str = "log2";
516+
else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP_USECS)
517+
flags_str = "usecs";
518+
519+
return flags_str;
520+
}
521+
500522
static void destroy_hist_field(struct hist_field *hist_field,
501523
unsigned int level)
502524
{
@@ -1495,28 +1517,6 @@ const struct file_operations event_hist_fops = {
14951517
.release = single_release,
14961518
};
14971519

1498-
static const char *get_hist_field_flags(struct hist_field *hist_field)
1499-
{
1500-
const char *flags_str = NULL;
1501-
1502-
if (hist_field->flags & HIST_FIELD_FL_HEX)
1503-
flags_str = "hex";
1504-
else if (hist_field->flags & HIST_FIELD_FL_SYM)
1505-
flags_str = "sym";
1506-
else if (hist_field->flags & HIST_FIELD_FL_SYM_OFFSET)
1507-
flags_str = "sym-offset";
1508-
else if (hist_field->flags & HIST_FIELD_FL_EXECNAME)
1509-
flags_str = "execname";
1510-
else if (hist_field->flags & HIST_FIELD_FL_SYSCALL)
1511-
flags_str = "syscall";
1512-
else if (hist_field->flags & HIST_FIELD_FL_LOG2)
1513-
flags_str = "log2";
1514-
else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP_USECS)
1515-
flags_str = "usecs";
1516-
1517-
return flags_str;
1518-
}
1519-
15201520
static void hist_field_print(struct seq_file *m, struct hist_field *hist_field)
15211521
{
15221522
const char *field_name = hist_field_name(hist_field, 0);

0 commit comments

Comments
 (0)