1 /* taskstats.h - exporting per-task statistics
3 * Copyright (C) Shailabh Nagar, IBM Corp. 2006
4 * (C) Balbir Singh, IBM Corp. 2006
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
10 * This program is distributed in the hope that it would be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 #ifndef _LINUX_TASKSTATS_H
16 #define _LINUX_TASKSTATS_H
18 /* Format for per-task data returned to userland when
20 * - listener requests stats for a task
22 * The struct is versioned. Newer versions should only add fields to
23 * the bottom of the struct to maintain backward compatibility.
27 * a) bump up TASKSTATS_VERSION
28 * b) add comment indicating new version number at end of struct
29 * c) add new fields after version comment; maintain 64-bit alignment
32 #define TASKSTATS_VERSION 1
41 #define TASKSTATS_LISTEN_GROUP 0x1
44 * Commands sent from userspace
45 * Not versioned. New commands should only be inserted at the enum's end
46 * prior to __TASKSTATS_CMD_MAX
50 TASKSTATS_CMD_UNSPEC = 0, /* Reserved */
51 TASKSTATS_CMD_GET, /* user->kernel request/get-response */
52 TASKSTATS_CMD_NEW, /* kernel->user event */
56 #define TASKSTATS_CMD_MAX (__TASKSTATS_CMD_MAX - 1)
59 TASKSTATS_TYPE_UNSPEC = 0, /* Reserved */
60 TASKSTATS_TYPE_PID, /* Process id */
61 TASKSTATS_TYPE_TGID, /* Thread group id */
62 TASKSTATS_TYPE_STATS, /* taskstats structure */
63 TASKSTATS_TYPE_AGGR_PID, /* contains pid + stats */
64 TASKSTATS_TYPE_AGGR_TGID, /* contains tgid + stats */
68 #define TASKSTATS_TYPE_MAX (__TASKSTATS_TYPE_MAX - 1)
71 TASKSTATS_CMD_ATTR_UNSPEC = 0,
72 TASKSTATS_CMD_ATTR_PID,
73 TASKSTATS_CMD_ATTR_TGID,
74 __TASKSTATS_CMD_ATTR_MAX,
77 #define TASKSTATS_CMD_ATTR_MAX (__TASKSTATS_CMD_ATTR_MAX - 1)
79 /* NETLINK_GENERIC related info */
81 #define TASKSTATS_GENL_NAME "TASKSTATS"
82 #define TASKSTATS_GENL_VERSION 0x1
84 #endif /* _LINUX_TASKSTATS_H */