Questo contenuto non è disponibile nella lingua selezionata.

Chapter 20. Managing tracepoints by using perf collector without restarting perf


Use the control pipe interface to manage different tracepoints in a running perf collector. You can dynamically adjust what data you are collecting without having to stop or restart perf. This prevents performance data loss that occurs when you stop or restart recording processes.

You can add tracepoints to a running perf collector by using the control pipe interface. perf adjusts the data being recorded without having to stop perf, therefore preventing the loss of performance data.

Prerequisites

  • You have the perf user space tool installed. For more information, see Installing perf.

Procedure

  1. Configure the control pipe interface:

    # mkfifo control ack perf.pipe
  2. Run perf record with the control file configuration and events you are interested in enabling:

    # perf record --control=fifo:control,ack -D -1 --no-buffering -e 'sched:*' -o - > perf.pipe

    In this example, declaring 'sched:*' after the -e option starts perf record with scheduler events.

  3. In a second command line, start the read side of the control pipe:

    # cat perf.pipe | perf --no-pager script -i -
  4. Starting the read side of the control pipe triggers the following message in the first command line:

    Events disabled
  5. In a third command line, enable a tracepoint by using the control file:

    # echo 'enable sched:sched_process_fork' > control

    This command triggers perf to scan the current event list in the control file for the declared event. If the event is present, the tracepoint is enabled and the following message appears in the first command line:

    event sched:sched_process_fork enabled
  6. Once the tracepoint is enabled, the second command line displays the output from perf detecting the tracepoint:

    bash 33349 [034] 149587.674295: sched:sched_process_fork: comm=bash pid=33349 child_comm=bash child_pid=34056

You can remove tracepoints from a running perf collector by using the control pipe interface. It helps to reduce the scope of data you are collecting without having to stop perf and losing performance data.

Prerequisites

Procedure

  • Remove the tracepoint:

    # echo 'disable sched:sched_process_fork' > control

    This example assumes you have previously loaded scheduler events into the control file and enabled the tracepoint sched:sched_process_fork.

    This command triggers perf to scan the current event list in the control file for the declared event. If found, the tracepoint is disabled and the following message appears in the command line used to configure the control pipe:

    # event sched:sched_process_fork disabled
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2026 Red Hat
Torna in cima