diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2015-09-25 09:06:34 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2015-09-25 09:06:34 +0200 |
commit | f96b29118a3ce99b1eb45e79564d5af382395607 (patch) | |
tree | 6724b41dbc9bb1ac8c22b1d005794ad8e67b3635 /xen/arch/x86/numa.c | |
parent | cf6d39f81992c29a637c603dbabf1e21a0ea563f (diff) |
keyhandler: rework keyhandler infrastructure
struct keyhandler does not contain much information, and requires a lot
of boilerplate to use. It is far more convenient to have
register_keyhandler() take each piece of information a parameter,
especially when introducing temporary debugging keyhandlers.
This in turn allows struct keyhandler itself to become private to
keyhandler.c and for the key_table to become more efficient.
key_table doesn't need to contain 256 entries; all keys are ASCII which
limits them to 7 bits of index, rather than 8. It can also become a
straight array, rather than an array of pointers. The overall effect of
this is the key_table grows in size by 50%, but there are no longer
24-byte keyhandler structures all over the data section.
All of the key_table entries in keyhandler.c can be initialised at
compile time rather than runtime.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/arch/x86/numa.c')
-rw-r--r-- | xen/arch/x86/numa.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/xen/arch/x86/numa.c b/xen/arch/x86/numa.c index 3041b247da..0e82dd4ed6 100644 --- a/xen/arch/x86/numa.c +++ b/xen/arch/x86/numa.c @@ -501,15 +501,9 @@ static void dump_numa(unsigned char key) rcu_read_unlock(&domlist_read_lock); } -static struct keyhandler dump_numa_keyhandler = { - .diagnostic = 1, - .u.fn = dump_numa, - .desc = "dump numa info" -}; - static __init int register_numa_trigger(void) { - register_keyhandler('u', &dump_numa_keyhandler); + register_keyhandler('u', dump_numa, "dump NUMA info", 1); return 0; } __initcall(register_numa_trigger); |