summaryrefslogtreecommitdiffstats
path: root/test/util.h
blob: dbeb4a8584f19f3f81bb31be612bfc4b5f7a4ee1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include <sys/types.h>
#include <stdbool.h>
#include <stdint.h>

#define ARRLEN(x) (sizeof(x) / sizeof((x)[0]))
#define MIN(a,b) ((a) > (b) ? (b) : (a))

void hexdump(void *data, int len);

bool pin_process(pid_t pid, int cpu, bool assert);

int read_stat_core(pid_t pid);

void print_counts(uint8_t *counts);
void print_counts_raw(uint8_t *counts);