tracing: Use pr_warn_once instead of open coded implementation
Use pr_warn_once, instead of making an open coded implementation. Link: http://lkml.kernel.org/r/513D8419.20400@huawei.com Signed-off-by: zhangwei(Jovi) <jovi.zhangwei@huawei.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
parent
6c43e554a2
commit
687c878afb
|
@ -5205,8 +5205,6 @@ static inline int register_snapshot_cmd(void) { return 0; }
|
||||||
|
|
||||||
struct dentry *tracing_init_dentry_tr(struct trace_array *tr)
|
struct dentry *tracing_init_dentry_tr(struct trace_array *tr)
|
||||||
{
|
{
|
||||||
static int once;
|
|
||||||
|
|
||||||
if (tr->dir)
|
if (tr->dir)
|
||||||
return tr->dir;
|
return tr->dir;
|
||||||
|
|
||||||
|
@ -5216,11 +5214,8 @@ struct dentry *tracing_init_dentry_tr(struct trace_array *tr)
|
||||||
if (tr->flags & TRACE_ARRAY_FL_GLOBAL)
|
if (tr->flags & TRACE_ARRAY_FL_GLOBAL)
|
||||||
tr->dir = debugfs_create_dir("tracing", NULL);
|
tr->dir = debugfs_create_dir("tracing", NULL);
|
||||||
|
|
||||||
if (!tr->dir && !once) {
|
if (!tr->dir)
|
||||||
once = 1;
|
pr_warn_once("Could not create debugfs directory 'tracing'\n");
|
||||||
pr_warning("Could not create debugfs directory 'tracing'\n");
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return tr->dir;
|
return tr->dir;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue