[DTrace-devel] [PATCH 2/8] sched: clean up unnecessary includes and functions
Eugene Loh
eugene.loh at oracle.com
Mon Mar 10 21:54:33 UTC 2025
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
On 3/7/25 16:34, Kris Van Hees via DTrace-devel wrote:
> Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
> libdtrace/dt_prov_sched.c | 30 ++----------------------------
> 1 file changed, 2 insertions(+), 28 deletions(-)
>
> diff --git a/libdtrace/dt_prov_sched.c b/libdtrace/dt_prov_sched.c
> index e05ef246..125d5891 100644
> --- a/libdtrace/dt_prov_sched.c
> +++ b/libdtrace/dt_prov_sched.c
> @@ -1,6 +1,6 @@
> /*
> * Oracle Linux DTrace.
> - * Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved.
> + * Copyright (c) 2023, 2025, Oracle and/or its affiliates. All rights reserved.
> * Licensed under the Universal Permissive License v 1.0 as shown at
> * http://oss.oracle.com/licenses/upl.
> *
> @@ -9,9 +9,6 @@
> #include <assert.h>
> #include <errno.h>
>
> -#include <linux/perf_event.h>
> -#include <perfmon/pfmlib_perf_event.h>
> -
> #include "dt_dctx.h"
> #include "dt_cg.h"
> #include "dt_provider_sdt.h"
> @@ -146,36 +143,13 @@ static int trampoline(dt_pcb_t *pcb, uint_t exitlbl)
> return 0;
> }
>
> -/*
> - * We need a custom enabling for on-cpu probes to ensure that the fbt function
> - * __perf_event_task_sched_in is called. __perf_event_task_sched_in will not
> - * be called unless context switch perf events have been enabled, so we do that
> - * here by opening a context switch count perf event but not attaching anything
> - * to it to minimize overhead. The alternative - attaching to
> - * cpc:::context_switches-all-1 and weeding out on- versus off-cpu events via a
> - * trampoline is too expensive. This approach works stably across kernels
> - * because __perf_event_task_sched_in() is not static, so not potentially
> - * subject to inlining or other optimizations.
> - */
> -static void enable(dtrace_hdl_t *dtp, dt_probe_t *prp)
> -{
> - return dt_sdt_enable(dtp, prp);
> -}
> -
> -static void detach(dtrace_hdl_t *dtp, const dt_probe_t *prp)
> -{
> - if (prp->prv_data)
> - close((int)(long)prp->prv_data);
> -}
> -
> dt_provimpl_t dt_sched = {
> .name = prvname,
> .prog_type = BPF_PROG_TYPE_UNSPEC,
> .populate = &populate,
> - .enable = &enable,
> + .enable = &dt_sdt_enable,
> .load_prog = &dt_bpf_prog_load,
> .trampoline = &trampoline,
> .probe_info = &dt_sdt_probe_info,
> - .detach = &detach,
> .destroy = &dt_sdt_destroy,
> };
More information about the DTrace-devel
mailing list