summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-12-23 10:38:11 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-24 09:01:05 +1000
commit2429513915ee11e42e44068c1f8f66ff179cd534 (patch)
treefb249aa98189fa3724df67a3e83ffb914a66e836
parentbdc40d1a769229082cf91f8fd344f230996a6440 (diff)
downloadxf86-input-wacom-2429513915ee11e42e44068c1f8f66ff179cd534.tar.gz
Auto-prepend device name/file to debug messages.
Add a new "name" field to the WacomDeviceRec. This field is at the same offset as the wcmDevice Field of the WacomCommonRec, hence the access to either is the same if casted. Then use this field to auto-prepend either the device name or the device file wherever a DBG macro is used. The output for DBG on priv is now (II) Wacom Intuos4 6x9 (xf86WcmMappingFactor): X factor = 0.0258, Y factor = 0.0309 and for DBG on common (II) /dev/input/event13 (wcmReadPacket): buffer has 112 bytes Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/wcmConfig.c1
-rw-r--r--src/xf86Wacom.h3
-rw-r--r--src/xf86WacomDefs.h2
3 files changed, 5 insertions, 1 deletions
diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index 2cb9de1..6f317b0 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -360,6 +360,7 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
goto SetupProc_fail;
priv = (WacomDevicePtr) local->private;
+ priv->name = local->name;
common = priv->common;
common->wcmDevice = device;
diff --git a/src/xf86Wacom.h b/src/xf86Wacom.h
index 194655a..c2194a7 100644
--- a/src/xf86Wacom.h
+++ b/src/xf86Wacom.h
@@ -77,7 +77,8 @@
#define DBG(lvl, priv, ...) \
do { \
if ((lvl) <= priv->debugLevel) { \
- xf86Msg(X_INFO, "%s: ", __func__); \
+ xf86Msg(X_INFO, "%s (%s): ", \
+ ((WacomDeviceRec*)priv)->name, __func__); \
xf86Msg(X_NONE, __VA_ARGS__); \
} \
} while (0)
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 6634d5c..80976b9 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -159,6 +159,7 @@ struct _PROPINFO
struct _WacomDeviceRec
{
+ char *name; /* Do not move, same offset as common->wcmDevice */
/* configuration fields */
struct _WacomDeviceRec *next;
LocalDevicePtr local;
@@ -370,6 +371,7 @@ struct _WacomDeviceClass
struct _WacomCommonRec
{
+ /* Do not move wcmDevice, same offset as priv->name */
char* wcmDevice; /* device file name */
dev_t min_maj; /* minor/major number */
unsigned char wcmFlags; /* various flags (handle tilt) */