PAPI 7.1.0.0
Loading...
Searching...
No Matches
linux-common.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  f_owner_ex
 

Macros

#define LINUX_VERSION(a, b, c)   ( ((a&0xff)<<24) | ((b&0xff)<<16) | ((c&0xff) << 8))
 
#define min(x, y)
 
#define F_SETOWN_EX   15
 
#define F_GETOWN_EX   16
 
#define F_OWNER_TID   0
 
#define F_OWNER_PID   1
 
#define F_OWNER_PGRP   2
 
#define _papi_getcpu()   0
 

Functions

static pid_t mygettid (void)
 
int _linux_detect_nmi_watchdog ()
 

Macro Definition Documentation

◆ _papi_getcpu

#define _papi_getcpu ( )    0

Definition at line 50 of file linux-common.h.

◆ F_GETOWN_EX

#define F_GETOWN_EX   16

Definition at line 30 of file linux-common.h.

◆ F_OWNER_PGRP

#define F_OWNER_PGRP   2

Definition at line 34 of file linux-common.h.

◆ F_OWNER_PID

#define F_OWNER_PID   1

Definition at line 33 of file linux-common.h.

◆ F_OWNER_TID

#define F_OWNER_TID   0

Definition at line 32 of file linux-common.h.

◆ F_SETOWN_EX

#define F_SETOWN_EX   15

Definition at line 29 of file linux-common.h.

◆ LINUX_VERSION

#define LINUX_VERSION (   a,
  b,
  c 
)    ( ((a&0xff)<<24) | ((b&0xff)<<16) | ((c&0xff) << 8))

Definition at line 4 of file linux-common.h.

◆ min

#define min (   x,
  y 
)
Value:
({ \
typeof(x) _min1 = (x); \
typeof(y) _min2 = (y); \
(void) (&_min1 == &_min2); \
_min1 < _min2 ? _min1 : _min2; })
volatile double y
volatile double x

Definition at line 6 of file linux-common.h.

Function Documentation

◆ _linux_detect_nmi_watchdog()

int _linux_detect_nmi_watchdog ( )

Definition at line 768 of file linux-common.c.

768 {
769
770 int watchdog_detected=0,watchdog_value=0;
771 FILE *fff;
772
773 fff=fopen("/proc/sys/kernel/nmi_watchdog","r");
774 if (fff!=NULL) {
775 if (fscanf(fff,"%d",&watchdog_value)==1) {
776 if (watchdog_value>0) watchdog_detected=1;
777 }
778 fclose(fff);
779 }
780
781 return watchdog_detected;
782}
FILE * fff[MAX_EVENTS]
int fclose(FILE *__stream)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ mygettid()

static pid_t mygettid ( void  )
inlinestatic

Definition at line 13 of file linux-common.h.

14{
15#if defined(__NEC__)
16 return 0;
17#else
18#ifdef SYS_gettid
19 return syscall( SYS_gettid );
20#elif defined(__NR_gettid)
21 return syscall( __NR_gettid );
22#else
23#error "cannot find gettid"
24#endif
25#endif
26}