| 1 |
/* SPDX-License-Identifier: GPL-2.0 */ |
| 2 |
/* |
| 3 |
* Trace events for the ChromeOS Embedded Controller |
| 4 |
* |
| 5 |
* Copyright 2025 Google LLC. |
| 6 |
*/ |
| 7 |
|
| 8 |
#undef TRACE_SYSTEM |
| 9 |
#define TRACE_SYSTEM cros_ec |
| 10 |
|
| 11 |
#if !defined(_CROS_EC_SENSORS_TRACE_H_) || defined(TRACE_HEADER_MULTI_READ) |
| 12 |
#define _CROS_EC_SENSORS_TRACE_H_ |
| 13 |
|
| 14 |
#include <linux/bits.h> |
| 15 |
#include <linux/types.h> |
| 16 |
#include <linux/platform_data/cros_ec_commands.h> |
| 17 |
#include <linux/platform_data/cros_ec_proto.h> |
| 18 |
|
| 19 |
#include <linux/tracepoint.h> |
| 20 |
|
| 21 |
TRACE_EVENT(cros_ec_motion_host_cmd, |
| 22 |
TP_PROTO(struct ec_params_motion_sense *param, |
| 23 |
struct ec_response_motion_sense *resp, |
| 24 |
int retval), |
| 25 |
TP_ARGS(param, resp, retval), |
| 26 |
TP_STRUCT__entry(__field(uint8_t, cmd) |
| 27 |
__field(uint8_t, sensor_id) |
| 28 |
__field(uint32_t, data) |
| 29 |
__field(int, retval) |
| 30 |
__field(int32_t, ret) |
| 31 |
), |
| 32 |
TP_fast_assign(__entry->cmd = param->cmd; |
| 33 |
__entry->sensor_id = param->sensor_odr.sensor_num; |
| 34 |
__entry->data = param->sensor_odr.data; |
| 35 |
__entry->retval = retval; |
| 36 |
__entry->ret = retval > 0 ? resp->sensor_odr.ret : -1; |
| 37 |
), |
| 38 |
TP_printk("%s, id: %d, data: %u, result: %u, return: %d", |
| 39 |
__print_symbolic(__entry->cmd, MOTIONSENSE_CMDS), |
| 40 |
__entry->sensor_id, |
| 41 |
__entry->data, |
| 42 |
__entry->retval, |
| 43 |
__entry->ret) |
| 44 |
); |
| 45 |
|
| 46 |
#endif /* _CROS_EC_SENSORS_TRACE_H_ */ |
| 47 |
|
| 48 |
/* this part must be outside header guard */ |
| 49 |
|
| 50 |
#undef TRACE_INCLUDE_PATH |
| 51 |
#define TRACE_INCLUDE_PATH ../../drivers/iio/common/cros_ec_sensors |
| 52 |
|
| 53 |
#undef TRACE_INCLUDE_FILE |
| 54 |
#define TRACE_INCLUDE_FILE cros_ec_sensors_trace |
| 55 |
|
| 56 |
#include <trace/define_trace.h> |