---
name: "PAPI_disable_component"
section: "3"
platform: "linux"
package: "libpapi-dev"
version: "7.1.0-5+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PAPI_disable_component"
---

# PAPI\_disable\_component(3)

disables the specified component

## NAME

PAPI\_disable\_component - disables the specified component

## SYNOPSIS

## Detailed Description

**Return values**

*ENOCMP* component does not exist \
 *ENOINIT* cannot disable as PAPI has already been initialized

**Parameters**

*cidx* component index of component to be disabled

**Examples:**

```
int cidx, result;
cidx = PAPI_get_component_index("example");
if (cidx>=0) {
   result = PAPI_disable_component(cidx);
   if (result==PAPI_OK)
      printf("The example component is disabled\n");
}
// ...
PAPI_library_init();
```

 **PAPI\_disable\_component()** allows the user to disable components before **PAPI\_library\_init()** time. This is useful if the user knows they do not wish to use events from that component and want to reduce the PAPI library overhead.

**PAPI\_disable\_component()** must be called before **PAPI\_library\_init()**.

**See also**

**PAPI\_get\_event\_component**

**PAPI\_library\_init**

## Author

Generated automatically by Doxygen for PAPI from the source code.
