Merge "clk: qcom: Enable ftrace for clock frequency measurement"

This commit is contained in:
qctecmdr authored and Gerrit - the friendly Code Review server committed 2023-01-16 03:30:06 -08:00
commit 0589df7994
2 files changed
+57

No files matched your search

+6
View File
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2016, 2019-2021 The Linux Foundation. All rights reserved. */
/* Copyright (c) 2023, Qualcomm Innovation Center, Inc. All rights reserved. */
#include <linux/clk.h>
#include <linux/export.h>
@@ -11,6 +12,10 @@
#include <linux/bitops.h>
#include <linux/mfd/syscon.h>
#include <linux/msm-bus.h>
#include <trace/events/power.h>
#define CREATE_TRACE_POINTS
#include "trace.h"
#include "clk-regmap.h"
#include "clk-debug.h"
@@ -271,6 +276,7 @@ static int clk_debug_measure_get(void *data, u64 *val)
enable_debug_clks(measure);
*val = clk_debug_mux_measure_rate(measure);
trace_clk_measure(clk_hw_get_name(hw), *val);
/* recursively calculate actual freq */
*val *= get_mux_divs(measure);
disable_debug_clks(measure);
+51
View File
@@ -0,0 +1,51 @@
/* SPDX-License-Identifier: GPL-2.0-only
*
* Copyright (c) 2022-2023, Qualcomm Innovation Center, Inc. All rights reserved.
*/
#undef TRACE_SYSTEM
#define TRACE_SYSTEM clk_qcom
#if !defined(_TRACE_CLOCK_QCOM_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_CLOCK_QCOM
#include <linux/tracepoint.h>
DECLARE_EVENT_CLASS(clk_measure_support,
TP_PROTO(const char *name, unsigned long rate),
TP_ARGS(name, rate),
TP_STRUCT__entry(
__string(name, name)
__field(unsigned long, rate)
),
TP_fast_assign(
__assign_str(name, name);
__entry->rate = rate;
),
TP_printk("%s rate: %lu",
__get_str(name), (unsigned long)__entry->rate)
);
DEFINE_EVENT(clk_measure_support, clk_measure,
TP_PROTO(const char *name, unsigned long rate),
TP_ARGS(name, rate)
);
#endif /* _TRACE_CLOCK_QCOM */
/* This part must be outside protection */
#undef TRACE_INCLUDE_PATH
#define TRACE_INCLUDE_PATH .
#undef TRACE_INCLUDE_FILE
#define TRACE_INCLUDE_FILE trace
#include <trace/define_trace.h>