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

Commit d35f2ab6 authored by Saravana Kannan's avatar Saravana Kannan Committed by Gerrit - the friendly Code Review server
Browse files

tracing: power: Add trace events for bw_hwmon



The bw_hwmon_meas trace event is to log measurement details and the
bw_hwmon_update trace event is to log the final decision.

Change-Id: I839ace50b1f1686227bcbf7d38a75f89092d26b1
Signed-off-by: default avatarSaravana Kannan <skannan@codeaurora.org>
parent 9f5234bb
Loading
Loading
Loading
Loading
+59 −0
Original line number Diff line number Diff line
@@ -871,6 +871,65 @@ DEFINE_EVENT(timer_status, single_cycle_exit_timer_stop,
		timer_rate, mode)
);

TRACE_EVENT(bw_hwmon_meas,

	TP_PROTO(const char *name, unsigned long mbps,
		 unsigned long us, int wake),

	TP_ARGS(name, mbps, us, wake),

	TP_STRUCT__entry(
		__string(	name,			name	)
		__field(	unsigned long,		mbps	)
		__field(	unsigned long,		us	)
		__field(	int,			wake	)
	),

	TP_fast_assign(
		__assign_str(name, name);
		__entry->mbps = mbps;
		__entry->us = us;
		__entry->wake = wake;
	),

	TP_printk("dev: %s, mbps = %lu, us = %lu, wake = %d",
		__get_str(name),
		__entry->mbps,
		__entry->us,
		__entry->wake)
);

TRACE_EVENT(bw_hwmon_update,

	TP_PROTO(const char *name, unsigned long mbps, unsigned long freq,
		 unsigned long up_thres, unsigned long down_thres),

	TP_ARGS(name, mbps, freq, up_thres, down_thres),

	TP_STRUCT__entry(
		__string(	name,			name		)
		__field(	unsigned long,		mbps		)
		__field(	unsigned long,		freq		)
		__field(	unsigned long,		up_thres	)
		__field(	unsigned long,		down_thres	)
	),

	TP_fast_assign(
		__assign_str(name, name);
		__entry->mbps = mbps;
		__entry->freq = freq;
		__entry->up_thres = up_thres;
		__entry->down_thres = down_thres;
	),

	TP_printk("dev: %s, mbps = %lu, freq = %lu, up = %lu, down = %lu",
		__get_str(name),
		__entry->mbps,
		__entry->freq,
		__entry->up_thres,
		__entry->down_thres)
);

#endif /* _TRACE_POWER_H */

/* This part must be outside protection */