Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d2db1d84 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "HID: Trace events for external sensor driver"

parents a01ac127 32f19a6c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ hid-picolcd-$(CONFIG_DEBUG_FS) += hid-picolcd_debugfs.o

obj-$(CONFIG_HID_PLANTRONICS)	+= hid-plantronics.o
obj-$(CONFIG_HID_PRIMAX)	+= hid-primax.o
obj-$(CONFIG_HID_QVR)		+= hid-qvr.o
obj-$(CONFIG_HID_QVR)		+= hid-qvr.o hid-trace.o
obj-$(CONFIG_HID_ROCCAT)	+= hid-roccat.o hid-roccat-common.o \
	hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \
	hid-roccat-koneplus.o hid-roccat-konepure.o hid-roccat-kovaplus.o \
+4 −0
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include "../soc/qcom/smp2p_private.h"
#include "hid-ids.h"
#include "hid-qvr.h"
#include "hid-trace.h"

static struct ion_handle *handle;
static struct ion_client *client;
@@ -142,6 +143,9 @@ int qvr_send_package_wrap(u8 *message, int msize, struct hid_device *hid)
	data->my = imuData.my0;
	data->mz = -imuData.mz0;

	trace_qvr_recv_sensor("gyro", data->gts, data->gx, data->gy, data->gz);
	trace_qvr_recv_sensor("accel", data->ats, data->ax, data->ay, data->az);

	pr_debug("%s: gts= %llu, gx= %d, gy=%d, gz=%d", __func__,
		data->gts, data->gx, data->gy, data->gz);
	pr_debug("%s: ats= %llu, ax= %d, ay=%d, az=%d", __func__,
+17 −0
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */


/* Instantiate tracepoints */
#define CREATE_TRACE_POINTS
#include "hid-trace.h"
+56 −0
Original line number Diff line number Diff line
/* Copyright (c) 2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#if !defined(_HID_TRACE_H) || defined(TRACE_HEADER_MULTI_READ)
#define _HID_TRACE_H

#undef TRACE_SYSTEM
#define TRACE_SYSTEM hid
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE hid-trace

#include <linux/tracepoint.h>

TRACE_EVENT(qvr_recv_sensor,
	TP_PROTO(char *sensor, uint64_t ts, s32 x, s32 y, s32 z),
	TP_ARGS(sensor, ts, x, y, z),
	TP_STRUCT__entry(
		__field(char *, sensor)
		__field(uint64_t, ts)
		__field(int, x)
		__field(int, y)
		__field(int, z)
		),
	TP_fast_assign(
		__entry->sensor = sensor;
		__entry->ts = ts;
		__entry->x = x;
		__entry->y = y;
		__entry->z = z;
		),
	TP_printk(
		"%s - ts=%llu x=%d y=%d z=%d",
		__entry->sensor,
		__entry->ts,
		__entry->x,
		__entry->y,
		__entry->z
		)
	);

#endif /* _HID_TRACE_H */

/* This part must be outside protection */
#include <trace/define_trace.h>