* [patch] hid: only dump report traffic with debug level 2
@ 2008-03-21 20:52 Anssi Hannula
2008-03-22 21:50 ` Jiri Kosina
0 siblings, 1 reply; 6+ messages in thread
From: Anssi Hannula @ 2008-03-21 20:52 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-input
Currently using debug=1 with hid module prints out all sent and received
reports to the kernel log, while in many cases we only want to see the
report descriptors and hid-input mappings that are printed when a device
is probed.
Add new level debug=2, and only dump the report traffic with that level.
Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
---
Index: linux-2.6.24-verbosehid/drivers/hid/hid-core.c
===================================================================
--- linux-2.6.24-verbosehid/drivers/hid/hid-core.c
+++ linux-2.6.24-verbosehid/drivers/hid/hid-core.c 2008-03-21 13:03:29.000000000 +0200
@@ -43,8 +43,8 @@
#ifdef CONFIG_HID_DEBUG
int hid_debug = 0;
-module_param_named(debug, hid_debug, bool, 0600);
-MODULE_PARM_DESC(debug, "Turn HID debugging mode on and off");
+module_param_named(debug, hid_debug, int, 0600);
+MODULE_PARM_DESC(debug, "HID debugging (0=off, 1=probing info, 2=continuous data dumping)");
EXPORT_SYMBOL_GPL(hid_debug);
#endif
Index: linux-2.6.24-verbosehid/drivers/hid/hid-debug.c
===================================================================
--- linux-2.6.24-verbosehid/drivers/hid/hid-debug.c
+++ linux-2.6.24-verbosehid/drivers/hid/hid-debug.c 2008-03-21 13:01:21.000000000 +0200
@@ -498,7 +498,7 @@
EXPORT_SYMBOL_GPL(hid_dump_device);
void hid_dump_input(struct hid_usage *usage, __s32 value) {
- if (!hid_debug)
+ if (hid_debug < 2)
return;
printk(KERN_DEBUG "hid-debug: input ");
-- Anssi Hannula
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] hid: only dump report traffic with debug level 2
2008-03-21 20:52 [patch] hid: only dump report traffic with debug level 2 Anssi Hannula
@ 2008-03-22 21:50 ` Jiri Kosina
2008-03-22 21:59 ` Anssi Hannula
0 siblings, 1 reply; 6+ messages in thread
From: Jiri Kosina @ 2008-03-22 21:50 UTC (permalink / raw)
To: Anssi Hannula; +Cc: linux-input
On Fri, 21 Mar 2008, Anssi Hannula wrote:
> Currently using debug=1 with hid module prints out all sent and received
> reports to the kernel log, while in many cases we only want to see the
> report descriptors and hid-input mappings that are printed when a device
> is probed.
Hi Anssi,
thanks for your patch, I agree that making this more configurable makes
sense.
But I would propose staying backwards compatible, i.e. debug=1 does the
whole dump, debug=2 excludes the individual reports but still dumps the
report descriptor and mappings etc. What do you think?
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] hid: only dump report traffic with debug level 2
2008-03-22 21:50 ` Jiri Kosina
@ 2008-03-22 21:59 ` Anssi Hannula
2008-03-22 22:31 ` Jiri Kosina
0 siblings, 1 reply; 6+ messages in thread
From: Anssi Hannula @ 2008-03-22 21:59 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-input
Jiri Kosina wrote:
> On Fri, 21 Mar 2008, Anssi Hannula wrote:
>
>> Currently using debug=1 with hid module prints out all sent and received
>> reports to the kernel log, while in many cases we only want to see the
>> report descriptors and hid-input mappings that are printed when a device
>> is probed.
>
> Hi Anssi,
>
> thanks for your patch, I agree that making this more configurable makes
> sense.
>
> But I would propose staying backwards compatible, i.e. debug=1 does the
> whole dump, debug=2 excludes the individual reports but still dumps the
> report descriptor and mappings etc. What do you think?
Well, I think having higher debug level should mean more debugging
output and that this logic is more important than backwards
compatibility of a debug option, it is not like it is going to break any
software or so.
But I don't care too much about it, feel free to do it the other way as
well :)
--
Anssi Hannula
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] hid: only dump report traffic with debug level 2
2008-03-22 21:59 ` Anssi Hannula
@ 2008-03-22 22:31 ` Jiri Kosina
2008-03-22 22:33 ` Anssi Hannula
0 siblings, 1 reply; 6+ messages in thread
From: Jiri Kosina @ 2008-03-22 22:31 UTC (permalink / raw)
To: Anssi Hannula; +Cc: linux-input
On Sat, 22 Mar 2008, Anssi Hannula wrote:
> Well, I think having higher debug level should mean more debugging
> output and that this logic is more important than backwards
> compatibility of a debug option, it is not like it is going to break any
> software or so.
I agee. On the other hand, I am currently quite often telling people who
(for example) complain about non-functioning keys on some expotic keyboard
"just modprobe the hid module with debug=1, press the non-functioning key,
and send me dmesg output". This would now be different depending on the
kernel version they use, which I don't like too much.
Thanks,
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] hid: only dump report traffic with debug level 2
2008-03-22 22:31 ` Jiri Kosina
@ 2008-03-22 22:33 ` Anssi Hannula
2008-03-22 22:36 ` Jiri Kosina
0 siblings, 1 reply; 6+ messages in thread
From: Anssi Hannula @ 2008-03-22 22:33 UTC (permalink / raw)
To: Jiri Kosina; +Cc: linux-input
Jiri Kosina wrote:
> On Sat, 22 Mar 2008, Anssi Hannula wrote:
>
>> Well, I think having higher debug level should mean more debugging
>> output and that this logic is more important than backwards
>> compatibility of a debug option, it is not like it is going to break any
>> software or so.
>
> I agee. On the other hand, I am currently quite often telling people who
> (for example) complain about non-functioning keys on some expotic keyboard
> "just modprobe the hid module with debug=1, press the non-functioning key,
> and send me dmesg output". This would now be different depending on the
> kernel version they use, which I don't like too much.
Wouldn't debug=2 work with older kernel versions as well?
--
Anssi Hannula
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [patch] hid: only dump report traffic with debug level 2
2008-03-22 22:33 ` Anssi Hannula
@ 2008-03-22 22:36 ` Jiri Kosina
0 siblings, 0 replies; 6+ messages in thread
From: Jiri Kosina @ 2008-03-22 22:36 UTC (permalink / raw)
To: Anssi Hannula; +Cc: linux-input
On Sun, 23 Mar 2008, Anssi Hannula wrote:
> > I agee. On the other hand, I am currently quite often telling people
> > who (for example) complain about non-functioning keys on some expotic
> > keyboard "just modprobe the hid module with debug=1, press the
> > non-functioning key, and send me dmesg output". This would now be
> > different depending on the kernel version they use, which I don't like
> > too much.
> Wouldn't debug=2 work with older kernel versions as well?
Of course it would, I need to have some rest, sorry for the noise :)
I will apply your patch to my tree, thanks.
--
Jiri Kosina
SUSE Labs
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-03-22 22:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-21 20:52 [patch] hid: only dump report traffic with debug level 2 Anssi Hannula
2008-03-22 21:50 ` Jiri Kosina
2008-03-22 21:59 ` Anssi Hannula
2008-03-22 22:31 ` Jiri Kosina
2008-03-22 22:33 ` Anssi Hannula
2008-03-22 22:36 ` Jiri Kosina
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).