|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH] xen: make keyhanler configurable
On 5/31/19 18:39, Dario Faggioli wrote: On Fri, 2019-05-31 at 09:58 +0800, Baodong Chen wrote:keyhandler mainly used for debug usage by developers which can dump xen module(eg. timer, scheduler) status at runtime by input character from console. Signed-off-by: Baodong Chen <chenbaodong@xxxxxxxxxx> --- --- a/xen/common/Kconfig +++ b/xen/common/Kconfig @@ -368,4 +368,13 @@ config DOM0_MEMLeave empty if you are not sure what to specify. +config HAS_KEYHANDLER+ bool "Enable/Disable keyhandler" + default y + ---help--- + Enable or disable keyhandler function. + keyhandler mainly used for debug usage by developers which can dump + xen module(eg. timer, scheduler) status at runtime by input character + from console. + endmenuI personally like the idea. I've probably would have called the option CONFIG_KEYHANDLERS, even if I can see that we have quite a few CONFIG_HAS_*. But it's not for me to ask/decide, and I don't have a too strong opinion on this anyway, so let's hear what others think. I'd at least add the 'S', though (as in CONFIG_HAS_KEYHANDLERS). Yes, can be fixed.
Me too, can leave it as what is was. but since schedule_dump prototype have external linkage.so even no one will call it, it maybe still in output executable file, right? --- a/xen/include/xen/keyhandler.h +++ b/xen/include/xen/keyhandler.h @@ -48,4 +49,17 @@ void register_irq_keyhandler(unsigned char key, /* Inject a keypress into the key-handling subsystem. */ extern void handle_keypress(unsigned char key, struct cpu_user_regs *regs);+#else the whole keyhandler.c will not compiled when config disabled. am i misunderstood something? --- a/xen/include/xen/lib.h +++ b/xen/include/xen/lib.h @@ -171,8 +171,10 @@ extern unsigned int tainted; extern char *print_tainted(char *str); extern void add_taint(unsigned int taint);+#ifdef CONFIG_HAS_KEYHANDLERstruct cpu_user_regs; void dump_execstate(struct cpu_user_regs *); +#endifYes. Or, you provide an empty stub of dump_execstate(), if CONFIG_HAS_KEYHANDLER is not defined, which means we don't have to mess with #ifdef-s at the caller site(s). Of course, I'm not maintainer of this specific piece of code, but I'd prefer this stub-based approach to be used in general.... ... ... Agree, can be fixed. --- a/xen/include/xen/sched.h +++ b/xen/include/xen/sched.h @@ -994,8 +994,10 @@ int cpupool_add_domain(struct domain *d, int poolid); void cpupool_rm_domain(struct domain *d); int cpupool_move_domain(struct domain *d, struct cpupool *c); int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op); +#ifdef CONFIG_HAS_KEYHANDLER void schedule_dump(struct cpupool *c); extern void dump_runq(unsigned char key); +#endifvoid arch_do_physinfo(struct xen_sysctl_physinfo *pi);... ... ... Like, for instance, in here. But again, sine these changes are spread around many files, let's see what others prefer, and use the same strategy everywhere. Regards _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |