Tomas Winkler | a0a927d | 2015-02-10 10:39:33 +0200 | [diff] [blame] | 1 | /* |
| 2 | * |
| 3 | * Intel Management Engine Interface (Intel MEI) Linux driver |
| 4 | * Copyright (c) 2015, Intel Corporation. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify it |
| 7 | * under the terms and conditions of the GNU General Public License, |
| 8 | * version 2, as published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope it will be useful, but WITHOUT |
| 11 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 12 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 13 | * more details. |
| 14 | * |
| 15 | */ |
| 16 | |
| 17 | #if !defined(_MEI_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) |
| 18 | #define _MEI_TRACE_H_ |
| 19 | |
| 20 | #include <linux/stringify.h> |
| 21 | #include <linux/types.h> |
| 22 | #include <linux/tracepoint.h> |
| 23 | |
Tomas Winkler | d2b5851 | 2015-03-04 18:41:35 +0200 | [diff] [blame^] | 24 | #include <linux/device.h> |
| 25 | |
Tomas Winkler | a0a927d | 2015-02-10 10:39:33 +0200 | [diff] [blame] | 26 | #undef TRACE_SYSTEM |
| 27 | |
| 28 | #define TRACE_SYSTEM mei |
| 29 | #define TRACE_SYSTEM_STRING __stringify(TRACE_SYSTEM) |
| 30 | |
| 31 | TRACE_EVENT(mei_reg_read, |
| 32 | TP_PROTO(const struct device *dev, const char *reg, u32 offs, u32 val), |
| 33 | TP_ARGS(dev, reg, offs, val), |
| 34 | TP_STRUCT__entry( |
| 35 | __string(dev, dev_name(dev)) |
| 36 | __field(const char *, reg) |
| 37 | __field(u32, offs) |
| 38 | __field(u32, val) |
| 39 | ), |
| 40 | TP_fast_assign( |
| 41 | __assign_str(dev, dev_name(dev)) |
| 42 | __entry->reg = reg; |
| 43 | __entry->offs = offs; |
| 44 | __entry->val = val; |
| 45 | ), |
| 46 | TP_printk("[%s] read %s:[%#x] = %#x", |
| 47 | __get_str(dev), __entry->reg, __entry->offs, __entry->val) |
| 48 | ); |
| 49 | |
| 50 | TRACE_EVENT(mei_reg_write, |
| 51 | TP_PROTO(const struct device *dev, const char *reg, u32 offs, u32 val), |
| 52 | TP_ARGS(dev, reg, offs, val), |
| 53 | TP_STRUCT__entry( |
| 54 | __string(dev, dev_name(dev)) |
| 55 | __field(const char *, reg) |
| 56 | __field(u32, offs) |
| 57 | __field(u32, val) |
| 58 | ), |
| 59 | TP_fast_assign( |
| 60 | __assign_str(dev, dev_name(dev)) |
| 61 | __entry->reg = reg; |
| 62 | __entry->offs = offs; |
| 63 | __entry->val = val; |
| 64 | ), |
| 65 | TP_printk("[%s] write %s[%#x] = %#x)", |
| 66 | __get_str(dev), __entry->reg, __entry->offs, __entry->val) |
| 67 | ); |
| 68 | |
| 69 | #endif /* _MEI_TRACE_H_ */ |
| 70 | |
| 71 | /* This part must be outside protection */ |
| 72 | #undef TRACE_INCLUDE_PATH |
| 73 | #undef TRACE_INCLUDE_FILE |
| 74 | #define TRACE_INCLUDE_PATH . |
| 75 | #define TRACE_INCLUDE_FILE mei-trace |
| 76 | #include <trace/define_trace.h> |