trace_osnoise.c (15ca4bdb0327b35e09682a0f7975e21688f54306) trace_osnoise.c (2bd1bdf01fb25906f18cd8ebfac81c2217d1478a)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * OS Noise Tracer: computes the OS Noise suffered by a running thread.
4 * Timerlat Tracer: measures the wakeup latency of a timer triggered IRQ and thread.
5 *
6 * Based on "hwlat_detector" tracer by:
7 * Copyright (C) 2008-2009 Jon Masters, Red Hat, Inc. <jcm@redhat.com>
8 * Copyright (C) 2013-2016 Steven Rostedt, Red Hat, Inc. <srostedt@redhat.com>

--- 1664 unchanged lines hidden (view full) ---

1673out_free:
1674 kfree(mask_str);
1675out_unlock:
1676 mutex_unlock(&interface_lock);
1677
1678 return count;
1679}
1680
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * OS Noise Tracer: computes the OS Noise suffered by a running thread.
4 * Timerlat Tracer: measures the wakeup latency of a timer triggered IRQ and thread.
5 *
6 * Based on "hwlat_detector" tracer by:
7 * Copyright (C) 2008-2009 Jon Masters, Red Hat, Inc. <jcm@redhat.com>
8 * Copyright (C) 2013-2016 Steven Rostedt, Red Hat, Inc. <srostedt@redhat.com>

--- 1664 unchanged lines hidden (view full) ---

1673out_free:
1674 kfree(mask_str);
1675out_unlock:
1676 mutex_unlock(&interface_lock);
1677
1678 return count;
1679}
1680
1681static int osnoise_workload_start(void);
1682static void osnoise_workload_stop(void);
1683
1684/*
1685 * osnoise_cpus_write - Write function for "cpus" entry
1686 * @filp: The active open file structure
1687 * @ubuf: The user buffer that contains the value to write
1688 * @cnt: The maximum number of bytes to write to "file"
1689 * @ppos: The current position in @file
1690 *
1691 * This function provides a write implementation for the "cpus"

--- 28 unchanged lines hidden (view full) ---

1720
1721 /*
1722 * trace_types_lock is taken to avoid concurrency on start/stop
1723 * and osnoise_busy.
1724 */
1725 mutex_lock(&trace_types_lock);
1726 running = osnoise_busy;
1727 if (running)
1681/*
1682 * osnoise_cpus_write - Write function for "cpus" entry
1683 * @filp: The active open file structure
1684 * @ubuf: The user buffer that contains the value to write
1685 * @cnt: The maximum number of bytes to write to "file"
1686 * @ppos: The current position in @file
1687 *
1688 * This function provides a write implementation for the "cpus"

--- 28 unchanged lines hidden (view full) ---

1717
1718 /*
1719 * trace_types_lock is taken to avoid concurrency on start/stop
1720 * and osnoise_busy.
1721 */
1722 mutex_lock(&trace_types_lock);
1723 running = osnoise_busy;
1724 if (running)
1728 osnoise_workload_stop();
1725 stop_per_cpu_kthreads();
1729
1730 mutex_lock(&interface_lock);
1731 /*
1732 * osnoise_cpumask is read by CPU hotplug operations.
1733 */
1734 cpus_read_lock();
1735
1736 cpumask_copy(&osnoise_cpumask, osnoise_cpumask_new);
1737
1738 cpus_read_unlock();
1739 mutex_unlock(&interface_lock);
1740
1741 if (running)
1726
1727 mutex_lock(&interface_lock);
1728 /*
1729 * osnoise_cpumask is read by CPU hotplug operations.
1730 */
1731 cpus_read_lock();
1732
1733 cpumask_copy(&osnoise_cpumask, osnoise_cpumask_new);
1734
1735 cpus_read_unlock();
1736 mutex_unlock(&interface_lock);
1737
1738 if (running)
1742 osnoise_workload_start();
1739 start_per_cpu_kthreads();
1743 mutex_unlock(&trace_types_lock);
1744
1745 free_cpumask_var(osnoise_cpumask_new);
1746 return count;
1747
1748err_free:
1749 free_cpumask_var(osnoise_cpumask_new);
1750

--- 371 unchanged lines hidden ---
1740 mutex_unlock(&trace_types_lock);
1741
1742 free_cpumask_var(osnoise_cpumask_new);
1743 return count;
1744
1745err_free:
1746 free_cpumask_var(osnoise_cpumask_new);
1747

--- 371 unchanged lines hidden ---