A component that gather info on VM stealtime.
More...
Go to the source code of this file.
|
| static int | read_stealtime (struct STEALTIME_context *context, int starting) |
| |
| static int | _stealtime_shutdown_component (void) |
| |
| static int | _stealtime_init_component (int cidx) |
| |
| static int | _stealtime_init_thread (hwd_context_t *ctx) |
| |
| static int | _stealtime_shutdown_thread (hwd_context_t *ctx) |
| |
| static int | _stealtime_init_control_state (hwd_control_state_t *ctl) |
| |
| static int | _stealtime_update_control_state (hwd_control_state_t *ctl, NativeInfo_t *native, int count, hwd_context_t *ctx) |
| |
| static int | _stealtime_start (hwd_context_t *ctx, hwd_control_state_t *ctl) |
| |
| static int | _stealtime_stop (hwd_context_t *ctx, hwd_control_state_t *ctl) |
| |
| static int | _stealtime_read (hwd_context_t *ctx, hwd_control_state_t *ctl, long long **events, int flags) |
| |
| static int | _stealtime_reset (hwd_context_t *ctx, hwd_control_state_t *ctrl) |
| |
| static int | _stealtime_ctl (hwd_context_t *ctx, int code, _papi_int_option_t *option) |
| |
| static int | _stealtime_set_domain (hwd_control_state_t *cntrl, int domain) |
| |
| static int | _stealtime_ntv_code_to_name (unsigned int EventCode, char *name, int len) |
| |
| static int | _stealtime_ntv_code_to_descr (unsigned int EventCode, char *name, int len) |
| |
| static int | _stealtime_ntv_code_to_info (unsigned int EventCode, PAPI_event_info_t *info) |
| |
| static int | _stealtime_ntv_enum_events (unsigned int *EventCode, int modifier) |
| |
◆ _stealtime_ctl()
Definition at line 456 of file linux-stealtime.c.
457{
458 ( void ) ctx;
459 ( void ) code;
460 ( void ) option;
461
463}
◆ _stealtime_init_component()
| static int _stealtime_init_component |
( |
int |
cidx | ) |
|
|
static |
Definition at line 137 of file linux-stealtime.c.
138{
141
143 char buffer[BUFSIZ],*
result,
string[BUFSIZ];
145
146
147 fff=fopen(
"/proc/stat",
"r");
153 goto fn_fail;
154 }
155
157 while(1) {
160
161
162
163 if (!strncmp(buffer,"cpu",3)) {
165 }
166 else {
167 break;
168 }
169
170 }
171
173
176 "Cannot find enough CPU lines in /proc/stat",
180 goto fn_fail;
181 }
182
187 goto fn_fail;
188 }
189
190
191 sysconf(_SC_CLK_TCK);
195
197 sprintf(
string,
"CPU%d",
i);
199 sprintf(
string,
"Steal time for CPU %d",
i);
202 }
203
204
205
209
210 fn_exit:
213 fn_fail:
214 goto fn_exit;
215}
struct papi_vectors * _papi_hwd[]
static int _stealtime_shutdown_component(void)
papi_vector_t _stealtime_vector
static struct counter_info * event_info
int fclose(FILE *__stream)
char disabled_reason[PAPI_HUGE_STR_LEN]
PAPI_component_info_t cmp_info
◆ _stealtime_init_control_state()
◆ _stealtime_init_thread()
Definition at line 225 of file linux-stealtime.c.
226{
228
231
234
237
239}
long long * current_count
◆ _stealtime_ntv_code_to_descr()
| static int _stealtime_ntv_code_to_descr |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
|
static |
Definition at line 519 of file linux-stealtime.c.
520{
521
522 int event=EventCode;
523
527 }
528
530}
◆ _stealtime_ntv_code_to_info()
Definition at line 535 of file linux-stealtime.c.
536{
537
538 int index = EventCode;
539
541
544
547
550
552
553}
char units[PAPI_MIN_STR_LEN]
char symbol[PAPI_HUGE_STR_LEN]
char long_descr[PAPI_HUGE_STR_LEN]
◆ _stealtime_ntv_code_to_name()
| static int _stealtime_ntv_code_to_name |
( |
unsigned int |
EventCode, |
|
|
char * |
name, |
|
|
int |
len |
|
) |
| |
|
static |
Definition at line 501 of file linux-stealtime.c.
502{
503
504 int event=EventCode;
505
509 }
510
512}
◆ _stealtime_ntv_enum_events()
| static int _stealtime_ntv_enum_events |
( |
unsigned int * |
EventCode, |
|
|
int |
modifier |
|
) |
| |
|
static |
Definition at line 562 of file linux-stealtime.c.
563{
564
567 *EventCode = 0;
569 }
570
572 int index;
573
574 index = *EventCode;
575
577 *EventCode = *EventCode + 1;
579 } else {
581 }
582 }
583
585}
◆ _stealtime_read()
Definition at line 389 of file linux-stealtime.c.
391{
392 ( void ) flags;
393
396
398
401
403
407 }
408
410
412
413}
char events[MAX_EVENTS][BUFSIZ]
static int read_stealtime(struct STEALTIME_context *context, int starting)
◆ _stealtime_reset()
Definition at line 422 of file linux-stealtime.c.
423{
424
425
426
428
430}
static int _stealtime_start(hwd_context_t *ctx, hwd_control_state_t *ctl)
◆ _stealtime_set_domain()
Definition at line 477 of file linux-stealtime.c.
478{
479 ( void ) cntrl;
480 int found = 0;
482 found = 1;
483 }
485 found = 1;
486 }
488 found = 1;
489 }
490 if ( !found )
492
494}
◆ _stealtime_shutdown_component()
| static int _stealtime_shutdown_component |
( |
void |
| ) |
|
|
static |
Definition at line 246 of file linux-stealtime.c.
247{
255 }
257 }
258
260}
char units[MAX_EVENTS][BUFSIZ]
◆ _stealtime_shutdown_thread()
◆ _stealtime_start()
Definition at line 341 of file linux-stealtime.c.
342{
343
344 (void)ctl;
345
346
348
349
351
353
354
355
356
357
359}
◆ _stealtime_stop()
Definition at line 366 of file linux-stealtime.c.
367{
368
369 (void) ctl;
370
371
373
374
376
378
380
381}
◆ _stealtime_update_control_state()
Definition at line 302 of file linux-stealtime.c.
306{
307
309
310 ( void ) ctx;
312
314
316
320 count*
sizeof(
long long));
321
322 }
323
324
329 }
330
332
334}
◆ read_stealtime()
Definition at line 74 of file linux-stealtime.c.
74 {
75
77 char buffer[BUFSIZ],*
result;
80
81 int hz=sysconf(_SC_CLK_TCK);
82
83
84 fff=fopen(
"/proc/stat",
"r");
87 }
88
92
93 count=sscanf(buffer,
"%*s %lld %lld %lld %lld %lld %lld %lld %lld %lld",
94 &our_stat.user,
95 &our_stat.nice,
96 &our_stat.system,
97 &our_stat.idle,
98 &our_stat.iowait,
99 &our_stat.irq,
100 &our_stat.softirq,
101 &our_stat.steal,
102 &our_stat.guest);
106 }
107
108 if (starting) {
110 }
112
113
115 (1000000/hz);
116 }
117
118
120
122
123}
◆ _stealtime_vector
◆ event_info
◆ num_events