ps2: allow more selective tracing

In some cases, we don't need the full tracking of every byte received at
the PS2 level, but higher level traces from specific devices will be
enough.

Change-Id: I31984e6b7784b5d033b457f43f3793f772213f4a
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4423
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
Adrien Destugues 2021-09-05 12:45:24 +02:00 committed by waddlesplash
parent cadaf7583f
commit fdbbdccc05
10 changed files with 79 additions and 3 deletions

View File

@ -18,6 +18,14 @@
#include "ps2_service.h"
//#define TRACE_PS2_ALPS
#ifdef TRACE_PS2_APLS
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
static int32 generate_event(timer* timer);

View File

@ -18,6 +18,14 @@
#include "ps2_dev.h"
//#define TRACE_PS2_COMMON
#ifdef TRACE_PS2_COMMON
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
isa_module_info *gIsa = NULL;
bool gActiveMultiplexingEnabled = false;
sem_id gControllerSem;

View File

@ -32,9 +32,15 @@
//#define TRACE_PS2
#ifdef TRACE_PS2
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#define TRACE_PS2_ALPS
#define TRACE_PS2_COMMON
#define TRACE_PS2_DEV
#define TRACE_PS2_ELANTECH
#define TRACE_PS2_MOUSE
#define TRACE_PS2_KEYBOARD
#define TRACE_PS2_SERVICE
#define TRACE_PS2_SYNAPTICS
#define TRACE_PS2_TRACKPOINT
#endif

View File

@ -24,6 +24,14 @@
#include <string.h>
//#define TRACE_PS2_DEV
#ifdef TRACE_PS2_DEV
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
ps2_dev ps2_device[PS2_DEVICE_COUNT];

View File

@ -18,6 +18,14 @@
#include "ps2_service.h"
//#define TRACE_PS2_ELANTECH
#ifdef TRACE_PS2_ELANTECH
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
static int32 generate_event(timer* timer);

View File

@ -30,6 +30,13 @@
#define KEY_BUFFER_SIZE 100
// we will buffer 100 key strokes before we start dropping them
//#define TRACE_PS2_KEYBOARD
#ifdef TRACE_PS2_KEYBOARD
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
enum {
LED_SCROLL = 1,
LED_NUM = 2,

View File

@ -21,6 +21,14 @@
#endif
//#define TRACE_PS2_SERVICE
#ifdef TRACE_PS2_SERVICE
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
typedef struct {
uint32 id;
ps2_dev * dev;

View File

@ -64,6 +64,14 @@
#include "ps2_standard_mouse.h"
//#define TRACE_PS2_MOUSE
#ifdef TRACE_PS2_MOUSE
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
const char* kStandardMousePath[4] = {
"input/mouse/ps2/standard_0",
"input/mouse/ps2/standard_1",

View File

@ -21,6 +21,13 @@
#include "ps2_service.h"
//#define TRACE_PS2_SYNAPTICS
#ifdef TRACE_PS2_SYNAPTICS
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
// synaptics touchpad proportions
#define SYN_EDGE_MOTION_WIDTH 50
#define SYN_AREA_OFFSET 40

View File

@ -15,6 +15,14 @@
#include "ps2_trackpoint.h"
//#define TRACE_PS2_TRACKPOINT
#ifdef TRACE_PS2_TRACKPOINT
# define TRACE(x...) dprintf(x)
#else
# define TRACE(x...)
#endif
const char* kTrackpointPath[4] = {
"input/mouse/ps2/ibm_trackpoint_0",
"input/mouse/ps2/ibm_trackpoint_1",