DEFINE_SEQ_ATTRIBUTE(snic_trc);
+#define TRC_ENABLE_FILE "tracing_enable"
+#define TRC_FILE "trace"
/*
* snic_trc_debugfs_init : creates trace/tracing_enable files for trace
* under debugfs
*/
void snic_trc_debugfs_init(void)
{
- snic_glob->trc.trc_enable = debugfs_create_bool("tracing_enable",
- S_IFREG | S_IRUGO | S_IWUSR,
- snic_glob->trc_root,
- &snic_glob->trc.enable);
-
- snic_glob->trc.trc_file = debugfs_create_file("trace",
- S_IFREG | S_IRUGO | S_IWUSR,
- snic_glob->trc_root, NULL,
- &snic_trc_fops);
+ debugfs_create_bool(TRC_ENABLE_FILE, S_IFREG | S_IRUGO | S_IWUSR,
+ snic_glob->trc_root, &snic_glob->trc.enable);
+
+ debugfs_create_file(TRC_FILE, S_IFREG | S_IRUGO | S_IWUSR,
+ snic_glob->trc_root, NULL, &snic_trc_fops);
}
/*
void
snic_trc_debugfs_term(void)
{
- debugfs_remove(snic_glob->trc.trc_file);
- snic_glob->trc.trc_file = NULL;
-
- debugfs_remove(snic_glob->trc.trc_enable);
- snic_glob->trc.trc_enable = NULL;
+ debugfs_remove(debugfs_lookup(TRC_FILE, snic_glob->trc_root));
+ debugfs_remove(debugfs_lookup(TRC_ENABLE_FILE, snic_glob->trc_root));
}