| /linux/kernel/events/ |
| H A D | hw_breakpoint_test.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * KUnit test for hw_breakpoint constraints accounting logic. 8 #include <kunit/test.h> 15 #define TEST_REQUIRES_BP_SLOTS(test, slots) \ argument 18 kunit_skip((test), "Requires breakpoint slots: %d > %d", slots, \ 23 #define TEST_EXPECT_NOSPC(expr) KUNIT_EXPECT_EQ(test, -ENOSPC, PTR_ERR(expr)) 31 static struct perf_event *register_test_bp(int cpu, struct task_struct *tsk, int idx) in register_test_bp() argument 42 return perf_event_create_kernel_counter(&attr, cpu, tsk, NULL, NULL); in register_test_bp() 65 static void fill_one_bp_slot(struct kunit *test, int *id, int cpu, struct task_struct *tsk) in fill_one_bp_slot() argument 67 struct perf_event *bp = register_test_bp(cpu, tsk, *id); in fill_one_bp_slot() [all …]
|
| /linux/tools/perf/tests/shell/ |
| H A D | record_offcpu.sh | 3 # SPDX-License-Identifier: GPL-2.0 5 set -e 14 rm -f ${perfdata} 15 rm -f ${perfdata}.old 16 trap - EXIT TERM INT 25 test_above_thresh="Threshold test (above threshold)" 26 test_below_thresh="Threshold test (below threshold)" 29 echo "Checking off-cpu privilege" 31 if [ "$(id -u)" != 0 ] 33 echo "off-cpu test [Skipped permission]" [all …]
|
| H A D | record_bpf_filter.sh | 3 # SPDX-License-Identifier: GPL-2.0 5 set -e 11 rm -f "${perfdata}" 12 rm -f "${perfdata}".old 13 trap - EXIT TERM INT 23 echo "Checking BPF-filter privilege" 25 if ! perf record -e task-clock --filter 'period > 1' \ 26 -o /dev/null --quiet true 2>&1 28 if [ "$(id -u)" != 0 ] 30 echo "try 'sudo perf record --setup-filter pin' first." [all …]
|
| H A D | test_intel_pt.sh | 3 # SPDX-License-Identifier: GPL-2.0 5 set -e 8 perf list pmu | grep -q 'intel_pt//' || exit 2 18 temp_dir=$(mktemp -d /tmp/perf-test-intel-pt-sh.XXXXXXXXXX) 20 tmpfile="${temp_dir}/tmp-perf.data" 21 perfdatafile="${temp_dir}/test-perf.data" 22 outfile="${temp_dir}/test-out.txt" 23 errfile="${temp_dir}/test-err.txt" 31 trap - EXIT TERM INT 32 sane=$(echo "${temp_dir}" | cut -b 1-26) [all …]
|
| /linux/lib/ |
| H A D | test_objpool.c | 1 // SPDX-License-Identifier: GPL-2.0 4 * Test module for lockless object pool 61 /* per-cpu worker */ 64 struct ot_test *test; /* test parameters */ member 85 static void *ot_kzalloc(struct ot_test *test, long size) in ot_kzalloc() argument 90 atomic_long_add(size, &test->data.kmalloc.alloc); in ot_kzalloc() 94 static void ot_kfree(struct ot_test *test, void *ptr, long size) in ot_kfree() argument 98 atomic_long_add(size, &test->data.kmalloc.free); in ot_kfree() 102 static void ot_mem_report(struct ot_test *test) in ot_mem_report() argument 106 pr_info("memory allocation summary for %s\n", test->name); in ot_mem_report() [all …]
|
| /linux/tools/testing/selftests/drivers/net/ |
| H A D | netcons_sysdata.sh | 2 # SPDX-License-Identifier: GPL-2.0 4 # A test that makes sure that sysdata runtime CPU data is properly set 7 # There are 3 different tests, every time sent using a random CPU. 8 # - Test #1 10 # - Test #2 12 # - Test #3 17 set -euo pipefail 19 SCRIPTDIR=$(dirname "$(readlink -e "${BASH_SOURCE[0]}")") 25 if [[ ! -f "${NETCONS_PATH}/userdata/cpu_nr_enabled" ]] 27 echo "Populate CPU configfs path not available in ${NETCONS_PATH}/userdata/cpu_nr_enabled" >&2 [all …]
|
| /linux/tools/perf/tests/ |
| H A D | topology.c | 1 // SPDX-License-Identifier: GPL-2.0 14 #define TEMPL "/tmp/perf-test-XXXXXX" 26 return -1; in get_temp() 44 session->evlist = evlist__new_default(); in session_write_header() 45 TEST_ASSERT_VAL("can't get evlist", session->evlist); in session_write_header() 46 session->evlist->session = session; in session_write_header() 48 perf_header__set_feat(&session->header, HEADER_CPU_TOPOLOGY); in session_write_header() 49 perf_header__set_feat(&session->header, HEADER_NRCPUS); in session_write_header() 50 perf_header__set_feat(&session->header, HEADER_ARCH); in session_write_header() 52 session->header.data_size += DATA_SIZE; in session_write_header() [all …]
|
| /linux/Documentation/devicetree/bindings/sound/ |
| H A D | test-component.yaml | 1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 3 --- 4 $id: http://devicetree.org/schemas/sound/test-component.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: Test Component 10 - Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> 15 - test-cpu 16 - test-cpu-verbose 17 - test-cpu-verbose-dai 18 - test-cpu-verbose-component [all …]
|
| /linux/kernel/irq/ |
| H A D | irq_test.c | 1 // SPDX-License-Identifier: LGPL-2.1+ 4 #include <linux/cpu.h> 11 #include <kunit/test.h> 44 static int irq_test_setup_fake_irq(struct kunit *test, struct irq_affinity_desc *affd) in irq_test_setup_fake_irq() argument 49 virq = irq_domain_alloc_descs(-1, 1, 0, NUMA_NO_NODE, affd); in irq_test_setup_fake_irq() 50 KUNIT_ASSERT_GE(test, virq, 0); in irq_test_setup_fake_irq() 55 KUNIT_ASSERT_PTR_NE(test, desc, NULL); in irq_test_setup_fake_irq() 63 static void irq_disable_depth_test(struct kunit *test) in irq_disable_depth_test() argument 68 virq = irq_test_setup_fake_irq(test, NULL); in irq_disable_depth_test() 71 KUNIT_ASSERT_PTR_NE(test, desc, NULL); in irq_disable_depth_test() [all …]
|
| /linux/tools/testing/selftests/mm/ |
| H A D | uffd-stress.c | 1 // SPDX-License-Identifier: GPL-2.0-only 7 * This test allocates two virtual areas and bounces the physical 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 37 #include "uffd-common.h" [all …]
|
| /linux/tools/testing/selftests/kvm/ |
| H A D | rseq_test.c | 1 // SPDX-License-Identifier: GPL-2.0-only 33 * Any bug related to task migration is likely to be timing-dependent; perform 51 static int next_cpu(int cpu) in next_cpu() argument 54 * Advance to the next CPU, skipping those that weren't in the original in next_cpu() 58 * burn a lot cycles and the test will take longer than normal to in next_cpu() 62 cpu++; in next_cpu() 63 if (cpu > max_cpu) { in next_cpu() 64 cpu = min_cpu; in next_cpu() 65 TEST_ASSERT(CPU_ISSET(cpu, &possible_mask), in next_cpu() 66 "Min CPU = %d must always be usable", cpu); in next_cpu() [all …]
|
| /linux/tools/testing/selftests/cgroup/ |
| H A D | test_cpuset_v1_hp.sh | 2 # SPDX-License-Identifier: GPL-2.0 4 # Test the special cpuset v1 hotplug case where a cpuset become empty of 10 echo "Test SKIPPED" 14 [[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!" 17 CPUSET=$(mount -t cgroup | grep cpuset | head -1 | awk -e '{print $3}') 18 [[ -n "$CPUSET" ]] || skip_test "cpuset v1 mount point not found!" 21 # Create a test cpuset, put a CPU and a task there and offline that CPU 23 TDIR=test$$ 24 [[ -d $CPUSET/$TDIR ]] || mkdir $CPUSET/$TDIR 32 echo "Unexpected cpuset $NEWCS, test FAILED!" [all …]
|
| H A D | test_cpuset_prs.sh | 2 # SPDX-License-Identifier: GPL-2.0 4 # Test for cpuset v2 partition root state (PRS) 12 echo "Test SKIPPED" 16 [[ $(id -u) -eq 0 ]] || skip_test "Test must be run as root!" 23 CGROUP2=$(mount -t cgroup2 | head -1 | awk -e '{print $3}') 24 [[ -n "$CGROUP2" ]] || skip_test "Cgroup v2 mount point not found!" 28 NR_CPUS=$(lscpu | grep "^CPU(s):" | sed -e "s/.*:[[:space:]]*//") 29 [[ $NR_CPUS -lt 8 ]] && skip_test "Test needs at least 8 cpus available!" 32 if [[ -c /dev/console && -w /dev/console ]] 44 while [[ "$1" = -* ]] [all …]
|
| /linux/drivers/cpufreq/ |
| H A D | amd-pstate-ut.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 3 * AMD Processor P-state Frequency Driver Unit Test 9 * The AMD P-State Unit Test is a test module for testing the amd-pstate 12 * test to avoid the kernel regression during the update. 3) We can 17 * additional test cases to improve the depth and coverage of the test. 19 * See Documentation/admin-guide/pm/amd-pstate.rst Unit Tests for 20 * amd-pstate to get more detail. 36 #include "amd-pstate.h" 45 * Kernel module for testing the AMD P-State unit test 78 return -EINVAL; in amd_pstate_ut_acpi_cpc_valid() [all …]
|
| /linux/tools/testing/selftests/resctrl/ |
| H A D | cat_test.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Cache Allocation Technology (CAT) test 18 * Minimum difference in LLC misses between a test with n+1 bits CBM to the 19 * test with n bits is MIN_DIFF_PERCENT_PER_BIT * (n - 1). With e.g. 5 vs 4 21 * MIN_DIFF_PERCENT_PER_BIT * (4 - 1) = 3 percent. 44 float delta = (__s64)(avg_llc_val - *prev_avg_llc_val); in show_results_info() 81 fp = fopen(param->filename, "r"); in check_results() 85 return -1; in check_results() 115 MIN_DIFF_PERCENT_PER_BIT * (bits - 1), in check_results() 137 * cat_test - Execute CAT benchmark and measure cache misses [all …]
|
| /linux/drivers/soc/fsl/qbman/ |
| H A D | Kconfig | 1 # SPDX-License-Identifier: GPL-2.0-only 26 Compiles in additional checks, to sanity-check the drivers and 30 tristate "BMan self-tests" 32 Compile the BMan self-test code. These tests will 37 bool "High-level API self-test" 41 This requires the presence of cpu-affine portals, and performs 42 high-level API testing with them (whichever portal(s) are affine 43 to the cpu(s) the test executes on). 46 tristate "QMan self-tests" 48 Compile self-test code for QMan. [all …]
|
| /linux/tools/testing/selftests/amd-pstate/ |
| H A D | run.sh | 2 # SPDX-License-Identifier: GPL-2.0 18 # amd-pstate-ut only run on x86/x86_64 AMD systems. 19 ARCH=$(uname -m 2>/dev/null | sed -e 's/i.86/x86/' -e 's/x86_64/x86/') 20 VENDOR=$(cat /proc/cpuinfo | grep -m 1 'vendor_id' | awk '{print $NF}') 38 CURRENT_TEST=amd-pstate 41 # Kselftest framework requirement - SKIP code is 4. 43 all_scaling_names=("acpi-cpufreq" "amd-pstate") 60 for cpu in `ls $CPUROOT | grep "cpu[0-9].*"`; do 61 if [ -d $CPUROOT/$cpu/cpufreq ]; then 77 policies=$(ls $CPUFREQROOT| grep "policy[0-9].*") [all …]
|
| /linux/tools/testing/selftests/rcutorture/bin/ |
| H A D | kvm-assign-cpus.sh | 2 # SPDX-License-Identifier: GPL-2.0+ 4 # Produce awk statements roughly depicting the system's CPU and cache 8 # Usage: kvm-assign-cpus.sh /path/to/sysfs 10 T="`mktemp -d ${TMPDIR-/tmp}/kvm-assign-cpus.sh.XXXXXX`" 11 trap 'rm -rf $T' 0 2 13 sysfsdir=${1-/sys/devices/system/node} 16 sed -e 's/^/# /' < $T/msg 19 nodelist="`ls -d node*`" 22 if ! test -d $i/ 27 for j in $i/cpu*/cache/index* [all …]
|
| H A D | kvm-get-cpus-script.sh | 2 # SPDX-License-Identifier: GPL-2.0+ 7 # Usage: kvm-get-cpus-script.sh /path/to/cpu/arrays /path/to/put/script [ /path/to/state ] 9 # The CPU arrays are output by kvm-assign-cpus.sh, and are valid awk 13 # non-empty), and can also be output by this script. 15 cpuarrays="${1-/sys/devices/system/node}" 19 if ! test -f "$cpuarrays" 25 if ! test -d "$scriptdir" || ! test -x "$scriptdir" || ! test -w "$scriptdir" 35 if test -r "$statefile" 42 # Do we have the system architecture to guide CPU affinity? 48 # Return a comma-separated list of the next n CPUs. [all …]
|
| /linux/tools/power/cpupower/bench/ |
| H A D | README-BENCH | 1 This is cpufreq-bench, a microbenchmark for the cpufreq framework. 7 - Identify worst case performance loss when doing dynamic frequency 9 - Identify average reaction time of a governor to CPU load changes 10 - (Stress) Testing whether a cpufreq low level driver or governor works 12 - Identify cpufreq related performance regressions between kernels 13 - Possibly Real time priority testing? -> what happens if there are 15 - ... 18 - Power saving related regressions (In fact as better the performance 21 - Real world (workloads) 27 cpufreq-bench helps to test the condition of a given cpufreq governor. [all …]
|
| /linux/tools/testing/selftests/net/ |
| H A D | reuseport_bpf_cpu.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * Test functionality of BPF filters with SO_REUSEPORT. This program creates 4 * an SO_REUSEPORT receiver group containing one socket per CPU core. It then 45 addr4->sin_family = AF_INET; in build_rcv_group() 46 addr4->sin_addr.s_addr = htonl(INADDR_ANY); in build_rcv_group() 47 addr4->sin_port = htons(PORT); in build_rcv_group() 51 addr6->sin6_family = AF_INET6; in build_rcv_group() 52 addr6->sin6_addr = in6addr_any; in build_rcv_group() 53 addr6->sin6_port = htons(PORT); in build_rcv_group() 105 saddr4->sin_family = AF_INET; in send_from_cpu() [all …]
|
| /linux/tools/testing/selftests/drivers/platform/x86/intel/ifs/ |
| H A D | test_ifs.sh | 2 # SPDX-License-Identifier: GPL-2.0 4 # Test the functionality of the Intel IFS(In Field Scan) driver. 13 readonly CPU_SYSFS="/sys/devices/system/cpu" 34 # Matches arch/x86/include/asm/intel-family.h and 61 echo -e "$1" | tee -a "$IFS_LOG" 68 local cpu="" 73 if [[ -n "$target_cpus" ]]; then 74 for cpu in $(echo "$target_cpus" | tr ',' ' '); do 75 if [[ "$cpu" == *"-"* ]]; then 79 cpu_start=$(echo "$cpu" | cut -d "-" -f 1) [all …]
|
| /linux/arch/mips/kernel/ |
| H A D | sync-r4k.c | 1 // SPDX-License-Identifier: GPL-2.0 17 #include <asm/r4k-timer.h> 35 * we want to have the fastest, inlined, non-debug version 36 * of a critical section, to be able to prove counter time-warps: 60 * another CPU) and update the previous counter timestamp. in check_counter_warp() 82 * we saw a time-warp of the counter going backwards: in check_counter_warp() 86 max_warp = max(max_warp, prev - now); in check_counter_warp() 90 * one CPU should observe time going backwards. in check_counter_warp() 99 WARN(!(now-start), in check_counter_warp() 101 now-start, end-start); in check_counter_warp() [all …]
|
| /linux/tools/testing/selftests/intel_pstate/ |
| H A D | run.sh | 2 # SPDX-License-Identifier: GPL-2.0 4 # This test runs on Intel x86 based hardware which support the intel_pstate 5 # driver. The test checks the frequency settings from the maximum turbo 7 # test runs the aperf.c program to put load on each processor. 13 # pstate the cpu is in, and the value of 14 # /sys/devices/system/cpu/intel_pstate/max_perf_pct X maximum turbo state 22 #/tmp/result.3100:1:cpu MHz : 2899.980 23 #/tmp/result.3100:2:cpu MHz : 2900.000 27 # and the test will error out in those cases. The result.X file can be checked 29 # files can be re-evaluated by setting EVALUATE_ONLY to 1 below. [all …]
|
| /linux/samples/bpf/ |
| H A D | map_perf_test_user.c | 1 // SPDX-License-Identifier: GPL-2.0-only 82 static void test_hash_prealloc(int cpu) in test_hash_prealloc() argument 90 printf("%d:hash_map_perf pre-alloc %lld events per sec\n", in test_hash_prealloc() 91 cpu, max_cnt * 1000000000ll / (time_get_ns() - start_time)); in test_hash_prealloc() 104 /* Populate the lru_hash_map for LRU_HASH_LOOKUP perf test. in pre_test_lru_hash_lookup() 120 static void do_test_lru(enum test_type test, int cpu) in do_test_lru() argument 129 if (test == INNER_LRU_HASH_PREALLOC && cpu) { in do_test_lru() 130 /* If CPU is not 0, create inner_lru hash map and insert the fd in do_test_lru() 131 * value into the array_of_lru_hash map. In case of CPU 0, in do_test_lru() 140 assert(cpu < MAX_NR_CPUS); in do_test_lru() [all …]
|