| /kernel/linux/linux-5.10/kernel/sched/ |
| D | sched_avg.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * Copyright (c) 2012, 2015-2021, The Linux Foundation. All rights reserved. 21 static DEFINE_PER_CPU(u64, nr); 43 int cpu; in sched_get_nr_running_avg() local 45 u64 period = curr_time - last_get_time; in sched_get_nr_running_avg() 52 for_each_possible_cpu(cpu) { in sched_get_nr_running_avg() 56 spin_lock_irqsave(&per_cpu(nr_lock, cpu), flags); in sched_get_nr_running_avg() 58 diff = curr_time - per_cpu(last_time, cpu); in sched_get_nr_running_avg() 61 tmp_nr = per_cpu(nr_prod_sum, cpu); in sched_get_nr_running_avg() 62 tmp_nr += per_cpu(nr, cpu) * diff; in sched_get_nr_running_avg() [all …]
|
| /kernel/linux/linux-5.10/tools/perf/util/ |
| D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0 25 map = perf_cpu_map__empty_new(cpus->nr); in cpu_map__from_entries() 29 for (i = 0; i < cpus->nr; i++) { in cpu_map__from_entries() 31 * Special treatment for -1, which is not real cpu number, in cpu_map__from_entries() 32 * and we need to use (int) -1 to initialize map[i], in cpu_map__from_entries() 35 if (cpus->cpu[i] == (u16) -1) in cpu_map__from_entries() 36 map->map[i] = -1; in cpu_map__from_entries() 38 map->map[i] = (int) cpus->cpu[i]; in cpu_map__from_entries() 48 int nr, nbits = mask->nr * mask->long_size * BITS_PER_BYTE; in cpu_map__from_mask() local 50 nr = bitmap_weight(mask->mask, nbits); in cpu_map__from_mask() [all …]
|
| D | cputopo.c | 1 // SPDX-License-Identifier: GPL-2.0 17 "%s/devices/system/cpu/cpu%d/topology/core_siblings_list" 19 "%s/devices/system/cpu/cpu%d/topology/die_cpus_list" 21 "%s/devices/system/cpu/cpu%d/topology/thread_siblings_list" 23 "%s/devices/system/cpu/cpu%d/topology/core_cpus_list" 31 static int build_cpu_topology(struct cpu_topology *tp, int cpu) in build_cpu_topology() argument 39 int ret = -1; in build_cpu_topology() 42 sysfs__mountpoint(), cpu); in build_cpu_topology() 56 for (i = 0; i < tp->core_sib; i++) { in build_cpu_topology() 57 if (!strcmp(buf, tp->core_siblings[i])) in build_cpu_topology() [all …]
|
| D | thread-stack.c | 1 // SPDX-License-Identifier: GPL-2.0-only 3 * thread-stack.c: Synthesize a thread's stack using call / return events 21 #include "call-path.h" 22 #include "thread-stack.h" 40 * struct thread_stack_entry - thread stack entry. 47 * @db_id: id used for db-export 68 * struct thread_stack - thread stack constructed from 'call' and 'return' 110 * perf_session__register_idle_thread(). The idle task is really 1 task per cpu, 111 * and therefore requires a stack for each cpu. 115 return !(thread->tid || thread->pid_); in thread_stack__per_cpu() [all …]
|
| /kernel/linux/linux-4.19/tools/perf/util/ |
| D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0 33 cpus->map[i] = i; in cpu_map__default_new() 35 cpus->nr = nr_cpus; in cpu_map__default_new() 36 refcount_set(&cpus->refcnt, 1); in cpu_map__default_new() 48 cpus->nr = nr_cpus; in cpu_map__trim_new() 49 memcpy(cpus->map, tmp_cpus, payload_size); in cpu_map__trim_new() 50 refcount_set(&cpus->refcnt, 1); in cpu_map__trim_new() 62 int n, cpu, prev; in cpu_map__read() local 66 prev = -1; in cpu_map__read() 68 n = fscanf(file, "%u%c", &cpu, &sep); in cpu_map__read() [all …]
|
| /kernel/linux/linux-4.19/arch/mips/sgi-ip27/ |
| D | ip27-nmi.c | 1 // SPDX-License-Identifier: GPL-2.0 20 #define CNODEID_NONE (cnodeid_t)-1 41 if (nmi_addr->call_addr) in install_cpu_nmi_handler() 43 nmi_addr->magic = NMI_MAGIC; in install_cpu_nmi_handler() 44 nmi_addr->call_addr = (void *)nmi_dump; in install_cpu_nmi_handler() 45 nmi_addr->call_addr_c = in install_cpu_nmi_handler() 46 (void *)(~((unsigned long)(nmi_addr->call_addr))); in install_cpu_nmi_handler() 47 nmi_addr->call_parm = 0; in install_cpu_nmi_handler() 51 * Copy the cpu registers which have been saved in the IP27prom format 57 struct reg_struct *nr; in nmi_cpu_eframe_save() local [all …]
|
| /kernel/linux/linux-5.10/arch/mips/sgi-ip27/ |
| D | ip27-nmi.c | 1 // SPDX-License-Identifier: GPL-2.0 42 if (nmi_addr->call_addr) in install_cpu_nmi_handler() 44 nmi_addr->magic = NMI_MAGIC; in install_cpu_nmi_handler() 45 nmi_addr->call_addr = (void *)nmi_dump; in install_cpu_nmi_handler() 46 nmi_addr->call_addr_c = in install_cpu_nmi_handler() 47 (void *)(~((unsigned long)(nmi_addr->call_addr))); in install_cpu_nmi_handler() 48 nmi_addr->call_parm = 0; in install_cpu_nmi_handler() 52 * Copy the cpu registers which have been saved in the IP27prom format 58 struct reg_struct *nr; in nmi_cpu_eframe_save() local 61 /* Get the pointer to the current cpu's register set. */ in nmi_cpu_eframe_save() [all …]
|
| /kernel/linux/linux-5.10/arch/powerpc/platforms/85xx/ |
| D | smp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 6 * Copyright 2006-2008, 2011-2012, 2015 Freescale Semiconductor Inc. 17 #include <linux/cpu.h> 26 #include <asm/code-patching.h> 59 qoriq_pm_ops->freeze_time_base(true); in mpc85xx_give_timebase() 62 * e5500/e6500 have a workaround for erratum A-006958 in place in mpc85xx_give_timebase() 63 * that will reread the timebase until TBL is non-zero. in mpc85xx_give_timebase() 67 * TBL is non-zero, we ensure that TB does not change. We don't in mpc85xx_give_timebase() 92 qoriq_pm_ops->freeze_time_base(false); in mpc85xx_give_timebase() 117 unsigned int cpu = smp_processor_id(); in smp_85xx_cpu_offline_self() local [all …]
|
| /kernel/linux/linux-4.19/arch/powerpc/platforms/85xx/ |
| D | smp.c | 5 * Copyright 2006-2008, 2011-2012, 2015 Freescale Semiconductor Inc. 21 #include <linux/cpu.h> 30 #include <asm/code-patching.h> 63 qoriq_pm_ops->freeze_time_base(true); in mpc85xx_give_timebase() 66 * e5500/e6500 have a workaround for erratum A-006958 in place in mpc85xx_give_timebase() 67 * that will reread the timebase until TBL is non-zero. in mpc85xx_give_timebase() 71 * TBL is non-zero, we ensure that TB does not change. We don't in mpc85xx_give_timebase() 96 qoriq_pm_ops->freeze_time_base(false); in mpc85xx_give_timebase() 121 unsigned int cpu = smp_processor_id(); in smp_85xx_mach_cpu_die() local 125 /* mask all irqs to prevent cpu wakeup */ in smp_85xx_mach_cpu_die() [all …]
|
| /kernel/linux/linux-4.19/Documentation/devicetree/bindings/powerpc/ |
| D | ibm,powerpc-cpu-features.txt | 3 (skiboot/doc/device-tree/ibm,powerpc-cpu-features/binding.txt) 9 ibm,powerpc-cpu-features binding 12 This device tree binding describes CPU features available to software, with 19 /cpus/ibm,powerpc-cpu-features node binding 20 ------------------------------------------- 22 Node: ibm,powerpc-cpu-features 24 Description: Container of CPU feature nodes. 26 The node name must be "ibm,powerpc-cpu-features". 35 - compatible 38 Definition: "ibm,powerpc-cpu-features" [all …]
|
| /kernel/linux/linux-5.10/Documentation/devicetree/bindings/powerpc/ |
| D | ibm,powerpc-cpu-features.txt | 3 (skiboot/doc/device-tree/ibm,powerpc-cpu-features/binding.txt) 9 ibm,powerpc-cpu-features binding 12 This device tree binding describes CPU features available to software, with 19 /cpus/ibm,powerpc-cpu-features node binding 20 ------------------------------------------- 22 Node: ibm,powerpc-cpu-features 24 Description: Container of CPU feature nodes. 26 The node name must be "ibm,powerpc-cpu-features". 35 - compatible 38 Definition: "ibm,powerpc-cpu-features" [all …]
|
| /kernel/linux/linux-5.10/arch/powerpc/platforms/powernv/ |
| D | smp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 17 #include <linux/cpu.h> 31 #include <asm/code-patching.h> 34 #include <asm/ppc-opcode.h> 49 static void pnv_smp_setup_cpu(int cpu) in pnv_smp_setup_cpu() argument 60 else if (cpu != boot_cpuid) in pnv_smp_setup_cpu() 64 static int pnv_smp_kick_cpu(int nr) in pnv_smp_kick_cpu() argument 72 if (nr < 0 || nr >= nr_cpu_ids) in pnv_smp_kick_cpu() 73 return -EINVAL; in pnv_smp_kick_cpu() 75 pcpu = get_hard_smp_processor_id(nr); in pnv_smp_kick_cpu() [all …]
|
| /kernel/linux/linux-4.19/arch/powerpc/platforms/powernv/ |
| D | smp.c | 21 #include <linux/cpu.h> 35 #include <asm/code-patching.h> 38 #include <asm/ppc-opcode.h> 53 static void pnv_smp_setup_cpu(int cpu) in pnv_smp_setup_cpu() argument 64 else if (cpu != boot_cpuid) in pnv_smp_setup_cpu() 68 static int pnv_smp_kick_cpu(int nr) in pnv_smp_kick_cpu() argument 76 if (nr < 0 || nr >= nr_cpu_ids) in pnv_smp_kick_cpu() 77 return -EINVAL; in pnv_smp_kick_cpu() 79 pcpu = get_hard_smp_processor_id(nr); in pnv_smp_kick_cpu() 82 * kick the CPU via the PACA in pnv_smp_kick_cpu() [all …]
|
| /kernel/linux/linux-5.10/tools/perf/tests/ |
| D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include "util/synthetic-events.h" 19 struct perf_record_cpu_map *map_event = &event->cpu_map; in process_event_mask() 25 data = &map_event->data; in process_event_mask() 27 TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__MASK); in process_event_mask() 29 mask = (struct perf_record_record_cpu_map *)data->data; in process_event_mask() 31 TEST_ASSERT_VAL("wrong nr", mask->nr == 1); in process_event_mask() 34 TEST_ASSERT_VAL("wrong cpu", test_bit(i, mask->mask)); in process_event_mask() 38 TEST_ASSERT_VAL("wrong nr", map->nr == 20); in process_event_mask() 41 TEST_ASSERT_VAL("wrong cpu", map->map[i] == i); in process_event_mask() [all …]
|
| /kernel/linux/linux-4.19/tools/testing/selftests/vm/ |
| D | userfaultfd.c | 7 * the COPYING file in the top-level directory. 13 * There are three threads running per CPU: 15 * 1) one per-CPU thread takes a per-page pthread_mutex in a random 17 * area_src), and increments a per-page counter in the same page, 20 * 2) another per-CPU thread handles the userfaults generated by 24 * 3) one last per-CPU thread transfers the memory in the background 26 * 2). Each cpu thread takes cares of transferring a portion of the 34 * per-CPU threads 1 by triggering userfaults inside 47 * # 10MiB-~6GiB 999 bounces, continue forever unless an error triggers 108 * to avoid non alignment faults on non-x86 archs. [all …]
|
| /kernel/linux/linux-4.19/arch/powerpc/platforms/pseries/ |
| D | smp.c | 26 #include <linux/cpu.h> 47 #include <asm/code-patching.h> 54 * The Primary thread of each non-boot processor was started from the OF client 59 /* Query where a cpu is now. Return codes #defined in plpar_wrappers.h */ 63 int qcss_tok = rtas_token("query-cpu-stopped-state"); in smp_query_cpu_stopped() 67 "Firmware doesn't support query-cpu-stopped-state\n"); in smp_query_cpu_stopped() 74 "RTAS query-cpu-stopped-state failed: %i\n", status); in smp_query_cpu_stopped() 82 * smp_startup_cpu() - start the given cpu 89 * 0 - failure 90 * 1 - success [all …]
|
| /kernel/linux/linux-5.10/tools/testing/selftests/vm/ |
| D | userfaultfd.c | 1 // SPDX-License-Identifier: GPL-2.0-only 11 * There are three threads running per CPU: 13 * 1) one per-CPU thread takes a per-page pthread_mutex in a random 15 * area_src), and increments a per-page counter in the same page, 18 * 2) another per-CPU thread handles the userfaults generated by 22 * 3) one last per-CPU thread transfers the memory in the background 24 * 2). Each cpu thread takes cares of transferring a portion of the 32 * per-CPU threads 1 by triggering userfaults inside 80 /* Whether to test uffd write-protection */ 94 int cpu; member [all …]
|
| /kernel/linux/linux-5.10/arch/powerpc/platforms/86xx/ |
| D | mpc86xx_smp.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 15 #include <asm/code-patching.h> 17 #include <asm/pci-bridge.h> 35 smp_86xx_release_core(int nr) in smp_86xx_release_core() argument 40 if (nr < 0 || nr >= NR_CPUS) in smp_86xx_release_core() 44 * Startup Core #nr. in smp_86xx_release_core() 49 pcr |= 1 << (nr + 24); in smp_86xx_release_core() 57 smp_86xx_kick_cpu(int nr) in smp_86xx_kick_cpu() argument 64 if (nr < 0 || nr >= NR_CPUS) in smp_86xx_kick_cpu() 65 return -ENOENT; in smp_86xx_kick_cpu() [all …]
|
| /kernel/linux/linux-5.10/tools/lib/perf/ |
| D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 18 cpus->nr = 1; in perf_cpu_map__dummy_new() 19 cpus->map[0] = -1; in perf_cpu_map__dummy_new() 20 refcount_set(&cpus->refcnt, 1); in perf_cpu_map__dummy_new() 29 WARN_ONCE(refcount_read(&map->refcnt) != 0, in cpu_map__delete() 38 refcount_inc(&map->refcnt); in perf_cpu_map__get() 44 if (map && refcount_dec_and_test(&map->refcnt)) in perf_cpu_map__put() 62 cpus->map[i] = i; in cpu_map__default_new() 64 cpus->nr = nr_cpus; in cpu_map__default_new() 65 refcount_set(&cpus->refcnt, 1); in cpu_map__default_new() [all …]
|
| D | evsel.c | 1 // SPDX-License-Identifier: GPL-2.0 21 INIT_LIST_HEAD(&evsel->node); in perf_evsel__init() 22 evsel->attr = *attr; in perf_evsel__init() 40 #define FD(e, x, y) (*(int *) xyarray__entry(e->fd, x, y)) 44 evsel->fd = xyarray__new(ncpus, nthreads, sizeof(int)); in perf_evsel__alloc_fd() 46 if (evsel->fd) { in perf_evsel__alloc_fd() 47 int cpu, thread; in perf_evsel__alloc_fd() local 48 for (cpu = 0; cpu < ncpus; cpu++) { in perf_evsel__alloc_fd() 50 FD(evsel, cpu, thread) = -1; in perf_evsel__alloc_fd() 55 return evsel->fd != NULL ? 0 : -ENOMEM; in perf_evsel__alloc_fd() [all …]
|
| /kernel/linux/linux-4.19/tools/perf/tests/ |
| D | cpumap.c | 1 // SPDX-License-Identifier: GPL-2.0 17 struct cpu_map_event *map_event = &event->cpu_map; in process_event_mask() 23 data = &map_event->data; in process_event_mask() 25 TEST_ASSERT_VAL("wrong type", data->type == PERF_CPU_MAP__MASK); in process_event_mask() 27 mask = (struct cpu_map_mask *)data->data; in process_event_mask() 29 TEST_ASSERT_VAL("wrong nr", mask->nr == 1); in process_event_mask() 32 TEST_ASSERT_VAL("wrong cpu", test_bit(i, mask->mask)); in process_event_mask() 36 TEST_ASSERT_VAL("wrong nr", map->nr == 20); in process_event_mask() 39 TEST_ASSERT_VAL("wrong cpu", map->map[i] == i); in process_event_mask() 51 struct cpu_map_event *map_event = &event->cpu_map; in process_event_cpus() [all …]
|
| /kernel/linux/linux-4.19/arch/powerpc/platforms/86xx/ |
| D | mpc86xx_smp.c | 18 #include <asm/code-patching.h> 21 #include <asm/pci-bridge.h> 38 smp_86xx_release_core(int nr) in smp_86xx_release_core() argument 43 if (nr < 0 || nr >= NR_CPUS) in smp_86xx_release_core() 47 * Startup Core #nr. in smp_86xx_release_core() 52 pcr |= 1 << (nr + 24); in smp_86xx_release_core() 60 smp_86xx_kick_cpu(int nr) in smp_86xx_kick_cpu() argument 67 if (nr < 0 || nr >= NR_CPUS) in smp_86xx_kick_cpu() 68 return -ENOENT; in smp_86xx_kick_cpu() 70 pr_debug("smp_86xx_kick_cpu: kick CPU #%d\n", nr); in smp_86xx_kick_cpu() [all …]
|
| /kernel/linux/linux-4.19/arch/powerpc/include/asm/ |
| D | smp.h | 2 * smp.h: PowerPC-specific SMP code. 8 * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com> 37 extern int cpu_to_chip_id(int cpu); 42 void (*message_pass)(int cpu, int msg); 44 void (*cause_ipi)(int cpu); 46 int (*cause_nmi_ipi)(int cpu); 48 int (*kick_cpu)(int nr); 49 int (*prepare_cpu)(int nr); 50 void (*setup_cpu)(int nr); 55 void (*cpu_die)(unsigned int nr); [all …]
|
| /kernel/linux/linux-5.10/arch/powerpc/include/asm/ |
| D | smp.h | 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 3 * smp.h: PowerPC-specific SMP code. 9 * Copyright (C) 1996-2001 Cort Dougan <cort@fsmlabs.com> 33 extern int cpu_to_chip_id(int cpu); 38 void (*message_pass)(int cpu, int msg); 40 void (*cause_ipi)(int cpu); 42 int (*cause_nmi_ipi)(int cpu); 44 int (*kick_cpu)(int nr); 45 int (*prepare_cpu)(int nr); 46 void (*setup_cpu)(int nr); [all …]
|
| /kernel/linux/linux-4.19/tools/perf/Documentation/ |
| D | perf.data-file-format.txt | 5 This document describes the on-disk perf.data format, generated by perf record 10 All fields are in native-endian of the machine that generated the perf.data. 14 format is described in "Pipe-mode data" section. The pipe data version can be 33 magic value is 64bit byte swapped compared the file is in non-native 62 uint32_t nr; 63 struct perf_header_string strings[nr]; /* variable length records */ 86 char filename[header.size - offsetof(struct build_id_event, filename)]; 92 (uname -n) 97 (uname -r) 107 A perf_header_string with the CPU architecture (uname -m) [all …]
|