1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Device core Trace Support
4 * Copyright (C) 2021, Intel Corporation
6 * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
10 #define TRACE_SYSTEM dev
12 #if !defined(__DEV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
15 #include <linux/device.h>
16 #include <linux/tracepoint.h>
17 #include <linux/types.h>
19 DECLARE_EVENT_CLASS(devres,
20 TP_PROTO(struct device *dev, const char *op, void *node, const char *name, size_t size),
21 TP_ARGS(dev, op, node, name, size),
23 __string(devname, dev_name(dev))
24 __field(struct device *, dev)
25 __field(const char *, op)
27 __field(const char *, name)
31 __assign_str(devname, dev_name(dev));
37 TP_printk("%s %3s %p %s (%zu bytes)", __get_str(devname),
38 __entry->op, __entry->node, __entry->name, __entry->size)
41 DEFINE_EVENT(devres, devres_log,
42 TP_PROTO(struct device *dev, const char *op, void *node, const char *name, size_t size),
43 TP_ARGS(dev, op, node, name, size)
46 #endif /* __DEV_TRACE_H */
48 /* this part has to be here */
50 #undef TRACE_INCLUDE_PATH
51 #define TRACE_INCLUDE_PATH .
53 #undef TRACE_INCLUDE_FILE
54 #define TRACE_INCLUDE_FILE trace
56 #include <trace/define_trace.h>