blob: 99912445974ce68938dc2777c0bef335f97c20db [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-only */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
3 * tracefs.h - a pseudo file system for activating tracing
4 *
5 * Based on debugfs by: 2004 Greg Kroah-Hartman <greg@kroah.com>
6 *
7 * Copyright (C) 2014 Red Hat Inc, author: Steven Rostedt <srostedt@redhat.com>
8 *
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00009 * tracefs is the file system that is used by the tracing infrastructure.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010 */
11
12#ifndef _TRACEFS_H_
13#define _TRACEFS_H_
14
15#include <linux/fs.h>
16#include <linux/seq_file.h>
17
18#include <linux/types.h>
19
20struct file_operations;
21
22#ifdef CONFIG_TRACING
23
24struct dentry *tracefs_create_file(const char *name, umode_t mode,
25 struct dentry *parent, void *data,
26 const struct file_operations *fops);
27
28struct dentry *tracefs_create_dir(const char *name, struct dentry *parent);
29
30void tracefs_remove(struct dentry *dentry);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000031
32struct dentry *tracefs_create_instance_dir(const char *name, struct dentry *parent,
33 int (*mkdir)(const char *name),
34 int (*rmdir)(const char *name));
35
36bool tracefs_initialized(void);
37
38#endif /* CONFIG_TRACING */
39
40#endif