ps2: improve tracing

Change-Id: I3991e1974ac4af2ba00d692284bfcf00e5b4cc84
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5386
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
PulkoMandy
2022-06-20 02:48:03 +00:00
committed by waddlesplash
parent d2837c97b7
commit a3d84aba73
4 changed files with 10 additions and 10 deletions
@@ -500,7 +500,7 @@ alps_close(void *_cookie)
// without a complete shutdown.
status_t status = ps2_reset_mouse(cookie->dev);
if (status != B_OK) {
INFO("ps2: reset failed\n");
INFO("ps2_alps: reset failed\n");
return B_ERROR;
}
@@ -72,7 +72,7 @@ ps2_dev_detect_pointing(ps2_dev* dev, device_hooks** hooks)
{
status_t status = ps2_reset_mouse(dev);
if (status != B_OK) {
INFO("ps2: reset failed\n");
INFO("ps2_dev: reset failed: %s\n", strerror(status));
return B_ERROR;
}
@@ -376,7 +376,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const uint8* out,
int out_count, uint8* in, int in_count, bigtime_t timeout)
{
status_t res;
#ifdef TRACE_PS2
#ifdef TRACE_PS2_DEV
bigtime_t start;
#endif
int32 sem_count;
@@ -436,7 +436,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const uint8* out,
}
release_sem(gControllerSem);
#ifdef TRACE_PS2
#ifdef TRACE_PS2_DEV
start = system_time();
#endif
res = acquire_sem_etc(dev->result_sem, 1, B_RELATIVE_TIMEOUT, timeout);
@@ -444,7 +444,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const uint8* out,
if (res != B_OK)
atomic_and(&dev->flags, ~PS2_FLAG_CMD);
#ifdef TRACE_PS2
#ifdef TRACE_PS2_DEV
TRACE("ps2: ps2_dev_command wait for ack res 0x%08" B_PRIx32 ", "
"wait-time %" B_PRId64 "\n", res, system_time() - start);
#endif
@@ -466,7 +466,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const uint8* out,
if (in_count == 0) {
atomic_and(&dev->flags, ~PS2_FLAG_CMD);
} else {
#ifdef TRACE_PS2
#ifdef TRACE_PS2_DEV
start = system_time();
#endif
res = acquire_sem_etc(dev->result_sem, 1, B_RELATIVE_TIMEOUT,
@@ -482,7 +482,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const uint8* out,
res = B_IO_ERROR;
}
#ifdef TRACE_PS2
#ifdef TRACE_PS2_DEV
TRACE("ps2: ps2_dev_command wait for input res 0x%08" B_PRIx32 ", "
"wait-time %" B_PRId64 "\n", res, system_time() - start);
for (i = 0; i < in_count; i++)
@@ -491,7 +491,7 @@ standard_command_timeout(ps2_dev* dev, uint8 cmd, const uint8* out,
}
}
TRACE("ps2: ps2_dev_command result 0x%08" B_PRIx32 "\n", res);
TRACE("ps2: ps2_dev_command result: %s\n", strerror(res));
return res;
}
@@ -683,7 +683,7 @@ elantech_close(void *_cookie)
// without a complete shutdown.
status_t status = ps2_reset_mouse(cookie->dev);
if (status != B_OK) {
INFO("ps2: reset failed\n");
INFO("ps2_elantech: reset failed\n");
return B_ERROR;
}
@@ -567,7 +567,7 @@ synaptics_close(void *_cookie)
// without a complete shutdown.
status = ps2_reset_mouse(cookie->dev);
if (status != B_OK) {
INFO("ps2: reset failed\n");
INFO("ps2_synaptics: reset failed\n");
return B_ERROR;
}