aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2014-02-04 20:07:27 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2014-02-04 20:07:27 -0500
commit48e8cdc06c6bf3e3344ef8824843d6a83434cea5 (patch)
tree482885b85b7c16455bd5d13d8f47646026f41ca8 /include
parent1c37b770a1898b1d95468aee69c443cfc04d21e1 (diff)
/proc/litmus: Export info. on CPU <-> cluster
This patch adds a framework by which plugins can export information about CPU <-> cluster (aka scheduling domain) per cluster. /proc/litmus/domains/<domain#>: This file contains a CPU mask describing the CPUs scheduled/managed by that domain. Files are named by index. For example, the first scheduling domain would be '0'. /proc/litmus/cpus/<cpus#>: This file contains a domain mask describing which domains manage this CPU. Normally, only one bit will be set in this mask, but overlapping clusters can also be expressed by setting multiple bits.
Diffstat (limited to 'include')
-rw-r--r--include/litmus/litmus_proc.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/include/litmus/litmus_proc.h b/include/litmus/litmus_proc.h
index 6800e725d48c..a5db24c03ec0 100644
--- a/include/litmus/litmus_proc.h
+++ b/include/litmus/litmus_proc.h
@@ -4,6 +4,22 @@
4int __init init_litmus_proc(void); 4int __init init_litmus_proc(void);
5void exit_litmus_proc(void); 5void exit_litmus_proc(void);
6 6
7struct cd_mapping
8{
9 int id;
10 cpumask_var_t mask;
11 struct proc_dir_entry *proc_file;
12};
13
14struct domain_proc_info
15{
16 int num_cpus;
17 int num_domains;
18
19 struct cd_mapping *cpu_to_domains;
20 struct cd_mapping *domain_to_cpus;
21};
22
7/* 23/*
8 * On success, returns 0 and sets the pointer to the location of the new 24 * On success, returns 0 and sets the pointer to the location of the new
9 * proc dir entry, otherwise returns an error code and sets pde to NULL. 25 * proc dir entry, otherwise returns an error code and sets pde to NULL.
@@ -17,6 +33,28 @@ long make_plugin_proc_dir(struct sched_plugin* plugin,
17 */ 33 */
18void remove_plugin_proc_dir(struct sched_plugin* plugin); 34void remove_plugin_proc_dir(struct sched_plugin* plugin);
19 35
36/*
37 * Setup the CPU <-> sched domain mappings in proc
38 */
39long activate_domain_proc(struct domain_proc_info* map);
40
41/*
42 * Remove the CPU <-> sched domain mappings from proc
43 */
44long deactivate_domain_proc(void);
45
46/*
47 * Alloc memory for the mapping
48 * Note: Does not set up proc files. Use make_sched_domain_maps for that.
49 */
50long init_domain_proc_info(struct domain_proc_info* map,
51 int num_cpus, int num_domains);
52
53/*
54 * Free memory of the mapping
55 * Note: Does not clean up proc files. Use deactivate_domain_proc for that.
56 */
57void destroy_domain_proc_info(struct domain_proc_info* map);
20 58
21/* Copy at most size-1 bytes from ubuf into kbuf, null-terminate buf, and 59/* Copy at most size-1 bytes from ubuf into kbuf, null-terminate buf, and
22 * remove a '\n' if present. Returns the number of bytes that were read or 60 * remove a '\n' if present. Returns the number of bytes that were read or