mirror of
https://github.com/LineageOS/android_kernel_fxtec_sm6115.git
synced 2026-04-26 11:53:10 +00:00
This will be used by eBPF and the iorapd project for high speed inode/dev numbers to file path lookup. Look at the inodemap CL for more details about of eBPF and iorapd using the tracepoint. This is planned to be used by the inodemap BPF program. Also, ART folks have been using this tracepoint for debugging "unknown inode numer" issues. The tracepoint will be out of tree, and not sent upstream, since VFS developers don't accept tracepoints strictly. Test: Run "find /" command in emulator and measure completion time with/without treacepoint. find does a flood of lookups which stresses the tracepoint. No performance change observed. Test: eBPF prototypes (wip) successfully read data from the tracepoint. OOT Bug: 139663736 Bug: 135143784 Bug: 137393447 Change-Id: I657f374659673a9c8853530d73c0622dbdbab146 Signed-off-by: Joel Fernandes <joelaf@google.com> (cherry picked from commit 987732fcbbe3ea78368c28e5a0d0d236be61420f)
43 lines
987 B
C
43 lines
987 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#undef TRACE_SYSTEM
|
|
#define TRACE_SYSTEM namei
|
|
|
|
#if !defined(_TRACE_INODEPATH_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
#define _TRACE_INODEPATH_H
|
|
|
|
#include <linux/types.h>
|
|
#include <linux/tracepoint.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/memcontrol.h>
|
|
#include <linux/device.h>
|
|
#include <linux/kdev_t.h>
|
|
|
|
TRACE_EVENT(inodepath,
|
|
TP_PROTO(struct inode *inode, char *path),
|
|
|
|
TP_ARGS(inode, path),
|
|
|
|
TP_STRUCT__entry(
|
|
/* dev_t and ino_t are arch dependent bit width
|
|
* so just use 64-bit
|
|
*/
|
|
__field(unsigned long, ino)
|
|
__field(unsigned long, dev)
|
|
__string(path, path)
|
|
),
|
|
|
|
TP_fast_assign(
|
|
__entry->ino = inode->i_ino;
|
|
__entry->dev = inode->i_sb->s_dev;
|
|
__assign_str(path, path);
|
|
),
|
|
|
|
TP_printk("dev %d:%d ino=%lu path=%s",
|
|
MAJOR(__entry->dev), MINOR(__entry->dev),
|
|
__entry->ino, __get_str(path))
|
|
);
|
|
#endif /* _TRACE_INODEPATH_H */
|
|
|
|
/* This part must be outside protection */
|
|
#include <trace/define_trace.h>
|