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

Commit 1186f5a2 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "sched/tracing: GKI friendly long preempt/irq disable traces"

parents 3ea5777d 1f833081
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -82,16 +82,6 @@ extern int sched_busy_hyst_handler(struct ctl_table *table, int write,
			void __user *buffer, size_t *lenp, loff_t *ppos);
#endif

#if defined(CONFIG_PREEMPTIRQ_EVENTS) || defined(CONFIG_PREEMPT_TRACER)
extern unsigned int sysctl_preemptoff_tracing_threshold_ns;
#endif
#if defined(CONFIG_PREEMPTIRQ_EVENTS) && defined(CONFIG_IRQSOFF_TRACER)
extern unsigned int sysctl_irqsoff_tracing_threshold_ns;
extern unsigned int sysctl_irqsoff_dmesg_output_enabled;
extern unsigned int sysctl_irqsoff_crash_sentinel_value;
extern unsigned int sysctl_irqsoff_crash_threshold_ns;
#endif

enum sched_tunable_scaling {
	SCHED_TUNABLESCALING_NONE,
	SCHED_TUNABLESCALING_LOG,
+0 −67
Original line number Diff line number Diff line
@@ -62,73 +62,6 @@ DEFINE_EVENT(preemptirq_template, preempt_enable,
#define trace_preempt_disable_rcuidle(...)
#endif

TRACE_EVENT(irqs_disable,

	TP_PROTO(u64 delta, unsigned long caddr0, unsigned long caddr1,
				unsigned long caddr2, unsigned long caddr3,
				unsigned long caddr4),

	TP_ARGS(delta, caddr0, caddr1, caddr2, caddr3, caddr4),

	TP_STRUCT__entry(
		__field(u64, delta)
		__field(void*, caddr0)
		__field(void*, caddr1)
		__field(void*, caddr2)
		__field(void*, caddr3)
		__field(void*, caddr4)
	),

	TP_fast_assign(
		__entry->delta = delta;
		__entry->caddr0 = (void *)caddr0;
		__entry->caddr1 = (void *)caddr1;
		__entry->caddr2 = (void *)caddr2;
		__entry->caddr3 = (void *)caddr3;
		__entry->caddr4 = (void *)caddr4;
	),

	TP_printk("delta=%llu(ns) Callers:(%ps<-%ps<-%ps<-%ps<-%ps)",
					__entry->delta, __entry->caddr0,
					__entry->caddr1, __entry->caddr2,
					__entry->caddr3, __entry->caddr4)
);

TRACE_EVENT(sched_preempt_disable,

	TP_PROTO(u64 delta, bool irqs_disabled,	unsigned long caddr0,
			unsigned long caddr1, unsigned long caddr2,
			unsigned long caddr3, unsigned long caddr4),

	TP_ARGS(delta, irqs_disabled, caddr0, caddr1, caddr2, caddr3, caddr4),

	TP_STRUCT__entry(
		__field(u64, delta)
		__field(bool, irqs_disabled)
		__field(void*, caddr0)
		__field(void*, caddr1)
		__field(void*, caddr2)
		__field(void*, caddr3)
		__field(void*, caddr4)
	),

	TP_fast_assign(
		__entry->delta = delta;
		__entry->irqs_disabled = irqs_disabled;
		__entry->caddr0 = (void *)caddr0;
		__entry->caddr1 = (void *)caddr1;
		__entry->caddr2 = (void *)caddr2;
		__entry->caddr3 = (void *)caddr3;
		__entry->caddr4 = (void *)caddr4;
	),

	TP_printk("delta=%llu(ns) irqs_d=%d Callers:(%ps<-%ps<-%ps<-%ps<-%ps)",
				__entry->delta, __entry->irqs_disabled,
				__entry->caddr0, __entry->caddr1,
				__entry->caddr2, __entry->caddr3,
				__entry->caddr4)
);

#endif /* _TRACE_PREEMPTIRQ_H */

#include <trace/define_trace.h>
+42 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2020 The Linux Foundation. All rights reserved.
 */

#undef TRACE_SYSTEM
#define TRACE_SYSTEM preemptirq_long

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

#include <linux/tracepoint.h>

DECLARE_EVENT_CLASS(preemptirq_long_template,

	TP_PROTO(u64 delta),

	TP_ARGS(delta),

	TP_STRUCT__entry(
		__field(u64, delta)
	),

	TP_fast_assign(
		__entry->delta = delta;
	),

	TP_printk("delta=%llu(ns)", __entry->delta)
);

DEFINE_EVENT(preemptirq_long_template, irq_disable_long,
	     TP_PROTO(u64 delta),
	     TP_ARGS(delta));

DEFINE_EVENT(preemptirq_long_template, preempt_disable_long,
	     TP_PROTO(u64 delta),
	     TP_ARGS(delta));

#endif /* _TRACE_PREEMPTIRQ_LONG_H */

/* This part must be outside protection */
#include <trace/define_trace.h>
+0 −46
Original line number Diff line number Diff line
@@ -140,9 +140,6 @@ static int ten_thousand = 10000;
#ifdef CONFIG_PERF_EVENTS
static int six_hundred_forty_kb = 640 * 1024;
#endif
static unsigned int __maybe_unused half_million = 500000;
static unsigned int __maybe_unused one_hundred_million = 100000000;
static unsigned int __maybe_unused one_million = 1000000;
static int __maybe_unused max_kswapd_threads = MAX_KSWAPD_THREADS;

#ifdef CONFIG_SCHED_WALT
@@ -340,49 +337,6 @@ static struct ctl_table kern_table[] = {
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
	},
#if defined(CONFIG_PREEMPT_TRACER) && defined(CONFIG_PREEMPTIRQ_EVENTS)
	{
		.procname	= "preemptoff_tracing_threshold_ns",
		.data		= &sysctl_preemptoff_tracing_threshold_ns,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
	},
#endif
#if defined(CONFIG_IRQSOFF_TRACER) && defined(CONFIG_PREEMPTIRQ_EVENTS)
	{
		.procname	= "irqsoff_tracing_threshold_ns",
		.data		= &sysctl_irqsoff_tracing_threshold_ns,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= proc_douintvec_minmax,
		.extra1		= &half_million,
		.extra2		= &one_hundred_million,
	},
	{
		.procname	= "irqsoff_dmesg_output_enabled",
		.data		= &sysctl_irqsoff_dmesg_output_enabled,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
	},
	{
		.procname	= "irqsoff_crash_sentinel_value",
		.data		= &sysctl_irqsoff_crash_sentinel_value,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= proc_dointvec,
	},
	{
		.procname	= "irqsoff_crash_threshold_ns",
		.data		= &sysctl_irqsoff_crash_threshold_ns,
		.maxlen		= sizeof(unsigned int),
		.mode		= 0644,
		.proc_handler	= proc_douintvec_minmax,
		.extra1		= &one_million,
		.extra2		= &one_hundred_million,
	},
#endif
#ifdef CONFIG_SCHED_WALT
	{
		.procname	= "sched_user_hint",
+2 −0
Original line number Diff line number Diff line
@@ -91,3 +91,5 @@ ifdef CONFIG_DEBUG_FS
obj-$(CONFIG_IPC_LOGGING) += ipc_logging_debug.o
endif
libftrace-y := ftrace.o

obj-$(CONFIG_PREEMPTIRQ_TRACEPOINTS) += preemptirq_long.o
Loading