1*09705dcbSAndy Shevchenko /* SPDX-License-Identifier: GPL-2.0 */ 2*09705dcbSAndy Shevchenko /* 3*09705dcbSAndy Shevchenko * Device core Trace Support 4*09705dcbSAndy Shevchenko * Copyright (C) 2021, Intel Corporation 5*09705dcbSAndy Shevchenko * 6*09705dcbSAndy Shevchenko * Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com> 7*09705dcbSAndy Shevchenko */ 8*09705dcbSAndy Shevchenko 9*09705dcbSAndy Shevchenko #undef TRACE_SYSTEM 10*09705dcbSAndy Shevchenko #define TRACE_SYSTEM dev 11*09705dcbSAndy Shevchenko 12*09705dcbSAndy Shevchenko #if !defined(__DEV_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) 13*09705dcbSAndy Shevchenko #define __DEV_TRACE_H 14*09705dcbSAndy Shevchenko 15*09705dcbSAndy Shevchenko #include <linux/device.h> 16*09705dcbSAndy Shevchenko #include <linux/tracepoint.h> 17*09705dcbSAndy Shevchenko #include <linux/types.h> 18*09705dcbSAndy Shevchenko 19*09705dcbSAndy Shevchenko DECLARE_EVENT_CLASS(devres, 20*09705dcbSAndy Shevchenko TP_PROTO(struct device *dev, const char *op, void *node, const char *name, size_t size), 21*09705dcbSAndy Shevchenko TP_ARGS(dev, op, node, name, size), 22*09705dcbSAndy Shevchenko TP_STRUCT__entry( 23*09705dcbSAndy Shevchenko __string(devname, dev_name(dev)) 24*09705dcbSAndy Shevchenko __field(struct device *, dev) 25*09705dcbSAndy Shevchenko __field(const char *, op) 26*09705dcbSAndy Shevchenko __field(void *, node) 27*09705dcbSAndy Shevchenko __field(const char *, name) 28*09705dcbSAndy Shevchenko __field(size_t, size) 29*09705dcbSAndy Shevchenko ), 30*09705dcbSAndy Shevchenko TP_fast_assign( 31*09705dcbSAndy Shevchenko __assign_str(devname, dev_name(dev)); 32*09705dcbSAndy Shevchenko __entry->op = op; 33*09705dcbSAndy Shevchenko __entry->node = node; 34*09705dcbSAndy Shevchenko __entry->name = name; 35*09705dcbSAndy Shevchenko __entry->size = size; 36*09705dcbSAndy Shevchenko ), 37*09705dcbSAndy Shevchenko TP_printk("%s %3s %p %s (%zu bytes)", __get_str(devname), 38*09705dcbSAndy Shevchenko __entry->op, __entry->node, __entry->name, __entry->size) 39*09705dcbSAndy Shevchenko ); 40*09705dcbSAndy Shevchenko 41*09705dcbSAndy Shevchenko DEFINE_EVENT(devres, devres_log, 42*09705dcbSAndy Shevchenko TP_PROTO(struct device *dev, const char *op, void *node, const char *name, size_t size), 43*09705dcbSAndy Shevchenko TP_ARGS(dev, op, node, name, size) 44*09705dcbSAndy Shevchenko ); 45*09705dcbSAndy Shevchenko 46*09705dcbSAndy Shevchenko #endif /* __DEV_TRACE_H */ 47*09705dcbSAndy Shevchenko 48*09705dcbSAndy Shevchenko /* this part has to be here */ 49*09705dcbSAndy Shevchenko 50*09705dcbSAndy Shevchenko #undef TRACE_INCLUDE_PATH 51*09705dcbSAndy Shevchenko #define TRACE_INCLUDE_PATH . 52*09705dcbSAndy Shevchenko 53*09705dcbSAndy Shevchenko #undef TRACE_INCLUDE_FILE 54*09705dcbSAndy Shevchenko #define TRACE_INCLUDE_FILE trace 55*09705dcbSAndy Shevchenko 56*09705dcbSAndy Shevchenko #include <trace/define_trace.h> 57