Something went wrong. Try again.
Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546#!/bin/bash -e# CoreSight concurrent threads (exclusive)
# SPDX-License-Identifier: GPL-2.0
# If CoreSight is not available, skip the testperf list pmu | grep -q cs_etm || exit 2
tmpdir=$(mktemp -d /tmp/__perf_test.coresight_concurrent_threads.XXXXX)
cleanup() { rm -rf "${tmpdir}" trap - EXIT TERM INT}
trap_cleanup() { cleanup exit 1}trap trap_cleanup EXIT TERM INT
cf="$tmpdir/ctl"af="$tmpdir/ack"mkfifo "$cf" "$af"
nthreads=10
# Timestamps off to reduce trace size, start disabled and use the control FIFO# to only record the workload and not startup.perf record -o "$tmpdir/data" -e cs_etm/timestamp=0/u -D -1 --control fifo:"$cf","$af" \ -- perf test --record-ctl fifo:"$cf","$af" -w named_threads $nthreads 1 > /dev/null 2>&1
perf script -i "$tmpdir/data" > "$tmpdir/script" 2>/dev/null
# Check all threads were traced and they have the correct thread name and symbolfor i in $(seq 1 $nthreads); do if ! grep -q "thread${i} .* named_threads_thread${i}" "$tmpdir/script"; then echo "Error: thread${i} missing" >&2 cleanup exit 1 fidone
cleanupexit 0