-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprocess.h
44 lines (38 loc) · 1004 Bytes
/
process.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
* Copyright 2010 Red Hat Inc.
* Author: Michal Schmidt
* License: GPLv2
*/
#ifndef _PROCESS_H
#define _PROCESS_H
#include <sys/types.h>
#include <stdint.h>
#include <stdlib.h>
#include "rbtree.h"
#include "back_trace.h"
struct latency_account {
uint64_t total;
uint64_t max;
int count;
};
struct bt2la {
struct rb_node rb_node;
struct back_trace bt; /* key in the rb-tree */
struct latency_account la;
};
struct process {
struct rb_node rb_node; /* tree of processes, sorted by tid */
struct rb_root bt2la_map; /* this process's latencies, sorted by the backtrace */
pid_t pid;
pid_t tid;
char comm[16];
struct latency_account summarized;
unsigned bt2la_count;
};
void process_suffer_latency(struct process *p, uint64_t delay,
struct back_trace *bt);
struct process *process_new(pid_t pid, pid_t tid, const char comm[16]);
void process_summarize(struct process *p);
void process_dump(struct process *p);
void process_fini(struct process *p);
#endif