CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
80 lines
1.9 KiB
Plaintext
80 lines
1.9 KiB
Plaintext
.TH "PAPI_attach" 3 "Wed Jun 25 2025 19:30:48" "Version 7.2.0.0" "PAPI" \" -*- nroff -*-
|
|
.ad l
|
|
.nh
|
|
.SH NAME
|
|
PAPI_attach \- Attach PAPI event set to the specified thread id\&.
|
|
|
|
.SH SYNOPSIS
|
|
.br
|
|
.PP
|
|
.SH "Detailed Description"
|
|
.PP
|
|
|
|
.PP
|
|
\fBC Interface:\fP
|
|
.RS 4
|
|
#include <\fBpapi\&.h\fP>
|
|
.br
|
|
int PAPI_attach( int EventSet, unsigned long tid );
|
|
.RE
|
|
.PP
|
|
\fBPAPI_attach\fP is a wrapper function that calls \fBPAPI_set_opt\fP to allow PAPI to monitor performance counts on a thread other than the one currently executing\&. This is sometimes referred to as third party monitoring\&. \fBPAPI_attach\fP connects the specified EventSet to the specified thread; \fBPAPI_detach\fP breaks that connection and restores the EventSet to the original executing thread\&.
|
|
.PP
|
|
\fBParameters\fP
|
|
.RS 4
|
|
\fIEventSet\fP An integer handle for a PAPI EventSet as created by \fBPAPI_create_eventset\fP\&.
|
|
.br
|
|
\fItid\fP A thread id as obtained from, for example, \fBPAPI_list_threads\fP or \fBPAPI_thread_id\fP\&.
|
|
.RE
|
|
.PP
|
|
\fBReturn values\fP
|
|
.RS 4
|
|
\fIPAPI_ECMP\fP This feature is unsupported on this component\&.
|
|
.br
|
|
\fIPAPI_EINVAL\fP One or more of the arguments is invalid\&.
|
|
.br
|
|
\fIPAPI_ENOEVST\fP The event set specified does not exist\&.
|
|
.br
|
|
\fIPAPI_EISRUN\fP The event set is currently counting events\&.
|
|
.RE
|
|
.PP
|
|
\fBExamples:\fP
|
|
.RS 4
|
|
|
|
.PP
|
|
.nf
|
|
int EventSet = PAPI_NULL;
|
|
unsigned long pid;
|
|
pid = fork( );
|
|
if ( pid <= 0 )
|
|
exit( 1 );
|
|
if ( PAPI_create_eventset( &EventSet ) != PAPI_OK )
|
|
exit( 1 );
|
|
// Add Total Instructions Executed to our EventSet
|
|
if ( PAPI_add_event( EventSet, PAPI_TOT_INS ) != PAPI_OK )
|
|
exit( 1 );
|
|
// Attach this EventSet to the forked process
|
|
if ( PAPI_attach( EventSet, pid ) != PAPI_OK )
|
|
exit( 1 );
|
|
|
|
.fi
|
|
.PP
|
|
.RE
|
|
.PP
|
|
\fBSee also\fP
|
|
.RS 4
|
|
\fBPAPI_set_opt\fP
|
|
.PP
|
|
\fBPAPI_list_threads\fP
|
|
.PP
|
|
\fBPAPI_thread_id\fP
|
|
.PP
|
|
\fBPAPI_thread_init\fP
|
|
.RE
|
|
.PP
|
|
|
|
|
|
.SH "Author"
|
|
.PP
|
|
Generated automatically by Doxygen for PAPI from the source code\&.
|