cregit-Linux how code gets into the kernel

Release 4.11 kernel/trace/trace_sched_switch.c

Directory: kernel/trace
/*
 * trace context switch
 *
 * Copyright (C) 2007 Steven Rostedt <srostedt@redhat.com>
 *
 */
#include <linux/module.h>
#include <linux/kallsyms.h>
#include <linux/uaccess.h>
#include <linux/ftrace.h>
#include <trace/events/sched.h>

#include "trace.h"


static int			sched_ref;
static DEFINE_MUTEX(sched_register_mutex);


static void probe_sched_switch(void *ignore, bool preempt, struct task_struct *prev, struct task_struct *next) { if (unlikely(!sched_ref)) return; tracing_record_cmdline(prev); tracing_record_cmdline(next); }

Contributors

PersonTokensPropCommitsCommitProp
Steven Rostedt2866.67%350.00%
Mathieu Desnoyers819.05%116.67%
Zhao Lei37.14%116.67%
Peter Zijlstra37.14%116.67%
Total42100.00%6100.00%


static void probe_sched_wakeup(void *ignore, struct task_struct *wakee) { if (unlikely(!sched_ref)) return; tracing_record_cmdline(current); }

Contributors

PersonTokensPropCommitsCommitProp
Ingo Molnar1551.72%233.33%
Mathieu Desnoyers724.14%233.33%
Steven Rostedt413.79%116.67%
Zhao Lei310.34%116.67%
Total29100.00%6100.00%


static int tracing_sched_register(void) { int ret; ret = register_trace_sched_wakeup(probe_sched_wakeup, NULL); if (ret) { pr_info("wakeup trace: Couldn't activate tracepoint" " probe to kernel_sched_wakeup\n"); return ret; } ret = register_trace_sched_wakeup_new(probe_sched_wakeup, NULL); if (ret) { pr_info("wakeup trace: Couldn't activate tracepoint" " probe to kernel_sched_wakeup_new\n"); goto fail_deprobe; } ret = register_trace_sched_switch(probe_sched_switch, NULL); if (ret) { pr_info("sched trace: Couldn't activate tracepoint" " probe to kernel_sched_switch\n"); goto fail_deprobe_wake_new; } return ret; fail_deprobe_wake_new: unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL); fail_deprobe: unregister_trace_sched_wakeup(probe_sched_wakeup, NULL); return ret; }

Contributors

PersonTokensPropCommitsCommitProp
Mathieu Desnoyers9689.72%250.00%
Steven Rostedt109.35%125.00%
Wenji Huang10.93%125.00%
Total107100.00%4100.00%


static void tracing_sched_unregister(void) { unregister_trace_sched_switch(probe_sched_switch, NULL); unregister_trace_sched_wakeup_new(probe_sched_wakeup, NULL); unregister_trace_sched_wakeup(probe_sched_wakeup, NULL); }

Contributors

PersonTokensPropCommitsCommitProp
Mathieu Desnoyers2379.31%266.67%
Steven Rostedt620.69%133.33%
Total29100.00%3100.00%


static void tracing_start_sched_switch(void) { mutex_lock(&sched_register_mutex); if (!(sched_ref++)) tracing_sched_register(); mutex_unlock(&sched_register_mutex); }

Contributors

PersonTokensPropCommitsCommitProp
Frédéric Weisbecker2064.52%250.00%
Mathieu Desnoyers1032.26%125.00%
Ingo Molnar13.23%125.00%
Total31100.00%4100.00%


static void tracing_stop_sched_switch(void) { mutex_lock(&sched_register_mutex); if (!(--sched_ref)) tracing_sched_unregister(); mutex_unlock(&sched_register_mutex); }

Contributors

PersonTokensPropCommitsCommitProp
Mathieu Desnoyers1548.39%125.00%
Frédéric Weisbecker1548.39%250.00%
Ingo Molnar13.23%125.00%
Total31100.00%4100.00%


void tracing_start_cmdline_record(void) { tracing_start_sched_switch(); }

Contributors

PersonTokensPropCommitsCommitProp
Steven Rostedt10100.00%1100.00%
Total10100.00%1100.00%


void tracing_stop_cmdline_record(void) { tracing_stop_sched_switch(); }

Contributors

PersonTokensPropCommitsCommitProp
Steven Rostedt10100.00%1100.00%
Total10100.00%1100.00%


Overall Contributors

PersonTokensPropCommitsCommitProp
Mathieu Desnoyers16351.26%214.29%
Steven Rostedt8627.04%428.57%
Frédéric Weisbecker4213.21%214.29%
Ingo Molnar175.35%321.43%
Zhao Lei61.89%17.14%
Peter Zijlstra30.94%17.14%
Wenji Huang10.31%17.14%
Total318100.00%14100.00%
Directory: kernel/trace
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.
Created with cregit.