]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - fs/xfs/scrub/trace.h
xfs: dispatch metadata scrub subcommands
[mirror_ubuntu-bionic-kernel.git] / fs / xfs / scrub / trace.h
CommitLineData
36fd6e86
DW
1/*
2 * Copyright (C) 2017 Oracle. All Rights Reserved.
3 *
4 * Author: Darrick J. Wong <darrick.wong@oracle.com>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it would be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20#undef TRACE_SYSTEM
21#define TRACE_SYSTEM xfs_scrub
22
23#if !defined(_TRACE_XFS_SCRUB_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
24#define _TRACE_XFS_SCRUB_TRACE_H
25
26#include <linux/tracepoint.h>
27
a5637186
DW
28DECLARE_EVENT_CLASS(xfs_scrub_class,
29 TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm,
30 int error),
31 TP_ARGS(ip, sm, error),
32 TP_STRUCT__entry(
33 __field(dev_t, dev)
34 __field(xfs_ino_t, ino)
35 __field(unsigned int, type)
36 __field(xfs_agnumber_t, agno)
37 __field(xfs_ino_t, inum)
38 __field(unsigned int, gen)
39 __field(unsigned int, flags)
40 __field(int, error)
41 ),
42 TP_fast_assign(
43 __entry->dev = ip->i_mount->m_super->s_dev;
44 __entry->ino = ip->i_ino;
45 __entry->type = sm->sm_type;
46 __entry->agno = sm->sm_agno;
47 __entry->inum = sm->sm_ino;
48 __entry->gen = sm->sm_gen;
49 __entry->flags = sm->sm_flags;
50 __entry->error = error;
51 ),
52 TP_printk("dev %d:%d ino %llu type %u agno %u inum %llu gen %u flags 0x%x error %d",
53 MAJOR(__entry->dev), MINOR(__entry->dev),
54 __entry->ino,
55 __entry->type,
56 __entry->agno,
57 __entry->inum,
58 __entry->gen,
59 __entry->flags,
60 __entry->error)
61)
62#define DEFINE_SCRUB_EVENT(name) \
63DEFINE_EVENT(xfs_scrub_class, name, \
64 TP_PROTO(struct xfs_inode *ip, struct xfs_scrub_metadata *sm, \
65 int error), \
66 TP_ARGS(ip, sm, error))
67
68DEFINE_SCRUB_EVENT(xfs_scrub_start);
69DEFINE_SCRUB_EVENT(xfs_scrub_done);
70
36fd6e86
DW
71#endif /* _TRACE_XFS_SCRUB_TRACE_H */
72
73#undef TRACE_INCLUDE_PATH
74#define TRACE_INCLUDE_PATH .
75#define TRACE_INCLUDE_FILE scrub/trace
76#include <trace/define_trace.h>