Skip to content
colognechip edited this page May 24, 2017 · 1 revision

mISDN_core debug via printk

Debug parameters for mISDN_core.ko :

#define DEBUG_CORE		0x000000ff
#define DEBUG_CORE_FUNC		0x00000002
#define DEBUG_SOCKET		0x00000004
#define DEBUG_MANAGER		0x00000008
#define DEBUG_SEND_ERR		0x00000010
#define DEBUG_MSG_THREAD	0x00000020
#define DEBUG_QUEUE_FUNC	0x00000040
#define DEBUG_L1		0x0000ff00
#define DEBUG_L1_FSM		0x00000200
#define DEBUG_L2		0x00ff0000
#define DEBUG_L2_FSM		0x00020000
#define DEBUG_L2_CTRL		0x00040000
#define DEBUG_L2_RECV		0x00080000
#define DEBUG_L2_TEI		0x00100000
#define DEBUG_L2_TEIFSM		0x00200000
#define DEBUG_TIMER		0x01000000
#define DEBUG_CLOCK		0x02000000

e.g. load mISDN_core with Layer1/Layer2 debug messages via

modprobe mISDN_core debug=0x00ffff00

on Debian systems get logs from syslog via

tail -f /var/log/syslog

layer1 driver debug via printk

every mISDNv2 Layer1 driver can process debug module param, too.

/*
 * HW DEBUG 0xHHHHGGGG
 * H - hardware driver specific bits
 * G - for all drivers
 */

#define DEBUG_HW                0x00000001
#define DEBUG_HW_OPEN           0x00000002
#define DEBUG_HW_DCHANNEL       0x00000100
#define DEBUG_HW_DFIFO          0x00000200
#define DEBUG_HW_BCHANNEL       0x00001000
#define DEBUG_HW_BFIFO          0x00002000

e.g. via

modprobe xhfc_su.ko debug=0x3FF

o check what driver custom debug flags are available, you have have a look into the sources, e.g. xhfc_su.h

layer1 driver debug via misdn_log

the user tool misdn_log provides on-the-fly D/E-Channel Logging to monitor Layer1/Layer2 Traffic.

./mISDNuser/tools/misdn_log

mISDN kernel version 1.01.29 (git.misdn.eu) found
mISDN user   version 1.01.31 found
2 controllers found
	id:		0
	Dprotocols:	00000006
	Bprotocols:	0000000e
	protocol:	0
	channelmap:	00000000000000000000000000000006
	nrbchan:	2
	name:		mISDN_l1loop.1
log bind ch(0) return 0
Echo channel logging no
20.10.2014 15:24:09.262054 DEACTIVATE IND id=0000ffff
20.10.2014 15:24:09.262059 MPH INFORMATION IND id=0000ffff  56 bytes 01 00 00 00  00 00 00 00  20 20 00 00  00 00 00 00
                                                                     00 00 02 00  00 00 00 00  00 00 00 00  00 00 00 00
                                                                     00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
                                                                     00 00 00 00  00 00 00 00

examples session

load modules (core + layer1)

modprobe mISDN_core debug=0x00ffff00
modprobe mISDN_l1loop vline=2 debug=0x3FF

console-1: tail kernel message log

tail -f /var/log/syslog

or

tail -f /var/log/messages

(depends on your system configuration / syslog daemon)

Oct 20 15:56:20 kernel: [  720.924994] base_sock_release(ffff8801daa0bcc0) sk=ffff8800364ed800
Oct 20 15:56:20 kernel: [  720.925010] mISDN_l1loop.1: l1loop_dctrl: cmd:100 ffff8801cf0a3e70
Oct 20 15:56:20 kernel: [  720.925013] mISDN_l1loop.1: open_dchannel: dev(0) open from ffffffffa07a9ead
Oct 20 15:56:20 kernel: [  720.925015] mISDN_l1loop.1: open_dchannel: dev(0) no NT found
Oct 20 15:56:20 kernel: [  720.925017] mISDN_l1loop.1: ph_state: ISDN_P_TE_S0 INACTIVE (0)
Oct 20 15:56:20 kernel: [  720.925024] connect_layer1: ret 0 (dev 0)
Oct 20 15:56:22 kernel: [  722.897241] base_sock_release(ffff8801d628c7c0) sk=ffff880036623400
Oct 20 15:56:22 kernel: [  722.897262] base_sock_release(ffff8801d628c7c0) sk=ffff880036623400
Oct 20 15:56:22 kernel: [  722.897276] mISDN_l1loop.1: l1loop_dctrl: cmd:100 ffff8801c608fe70
Oct 20 15:56:22 kernel: [  722.897279] mISDN_l1loop.1: open_dchannel: dev(0) open from ffffffffa07a9ead
Oct 20 15:56:22 kernel: [  722.897281] mISDN_l1loop.1: open_dchannel: dev(0) no NT found
Oct 20 15:56:22 kernel: [  722.897283] mISDN_l1loop.1: ph_state: ISDN_P_TE_S0 INACTIVE (0)
Oct 20 15:56:22 kernel: [  722.897299] connect_layer1: ret 0 (dev 0)
Oct 20 15:56:22 kernel: [  722.897354] mISDN_l1loop.1: l1loop_l2l1D: PH_ACTIVATE_REQ ISDN_P_TE_S0
Oct 20 15:56:22 kernel: [  722.897360] mISDN_l1loop.1: ph_command: 1
Oct 20 15:56:22 kernel: [  722.897370] mISDN_l1loop.1: ph_state: ISDN_P_TE_S0 ACTIVE (0)
Oct 20 15:56:24 kernel: [  725.209349] mISDN_l1loop.1: l1loop_dctrl: cmd:200           (null)
Oct 20 15:56:24 kernel: [  725.209354] mISDN_l1loop.1: l1loop_dctrl: dev(0) close from ffffffffa07a787c

console-2: monitor layer1 <-> layer2 data

mISDNuser/tools/misdn_log
mISDN kernel version 1.01.29 (git.misdn.eu) found
mISDN user   version 1.01.31 found
2 controllers found
        id:             0
        Dprotocols:     00000006
        Bprotocols:     0000000e
        protocol:       1
        channelmap:     00000000000000000000000000000006
        nrbchan:        2
        name:           mISDN_l1loop.1
log bind ch(0) return 0
Echo channel logging no
20.10.2014 15:58:41.164751 DEACTIVATE IND id=0000ffff
20.10.2014 15:58:41.164783 MPH INFORMATION IND id=0000ffff  56 bytes 01 00 00 00  00 00 00 00  20 20 00 00  00 00 00 00
                                                                     00 00 02 00  00 00 00 00  00 00 00 00  00 00 00 00
                                                                     00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
                                                                     00 00 00 00  00 00 00 00
20.10.2014 15:58:43.058025 DEACTIVATE IND id=0000ffff
20.10.2014 15:58:43.058028 MPH INFORMATION IND id=0000ffff  56 bytes 01 00 00 00  00 00 00 00  20 20 00 00  00 00 00 00
                                                                     00 00 02 00  00 00 00 00  00 00 00 00  00 00 00 00
                                                                     00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
                                                                     00 00 00 00  00 00 00 00
20.10.2014 15:58:43.058059 ACTIVATE REQ id=0000ffff
20.10.2014 15:58:43.058078 ACTIVATE IND id=0000ffff
20.10.2014 15:58:43.058084 MPH INFORMATION IND id=0000ffff  56 bytes 01 00 00 00  00 00 00 00  60 20 00 00  00 00 00 00
                                                                     01 00 02 00  00 00 00 00  00 00 00 00  00 00 00 00
                                                                     00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
                                                                     00 00 00 00  00 00 00 00
20.10.2014 15:58:43.058266 DATA REQ id=00000000  64 bytes 02 00 00 00  00 00 01 02  03 04 05 06  07 08 09 0a
                                                          0b 0c 0d 0e  0f 10 11 12  13 14 15 16  17 18 19 1a
                                                          1b 1c 1d 1e  1f 20 21 22  23 24 25 26  27 28 29 2a
                                                          2b 2c 2d 2e  2f 30 31 32  33 34 35 36  37 38 39 3a
20.10.2014 15:58:43.058275 DATA CNF id=00000000
20.10.2014 15:58:43.058286 DATA IND id=00000000  64 bytes 02 00 00 00  00 00 01 02  03 04 05 06  07 08 09 0a
                                                          0b 0c 0d 0e  0f 10 11 12  13 14 15 16  17 18 19 1a
                                                          1b 1c 1d 1e  1f 20 21 22  23 24 25 26  27 28 29 2a
                                                          2b 2c 2d 2e  2f 30 31 32  33 34 35 36  37 38 39 3a
20.10.2014 15:58:43.059044 DATA REQ id=00000000  64 bytes 02 00 00 00  01 00 01 02  03 04 05 06  07 08 09 0a
                                                          0b 0c 0d 0e  0f 10 11 12  13 14 15 16  17 18 19 1a
                                                          1b 1c 1d 1e  1f 20 21 22  23 24 25 26  27 28 29 2a
                                                          2b 2c 2d 2e  2f 30 31 32  33 34 35 36  37 38 39 3a
20.10.2014 15:58:43.059052 DATA CNF id=00000000
20.10.2014 15:58:43.059062 DATA IND id=00000000  64 bytes 02 00 00 00  01 00 01 02  03 04 05 06  07 08 09 0a
                                                          0b 0c 0d 0e  0f 10 11 12  13 14 15 16  17 18 19 1a
                                                          1b 1c 1d 1e  1f 20 21 22  23 24 25 26  27 28 29 2a
                                                          2b 2c 2d 2e  2f 30 31 32  33 34 35 36  37 38 39 3a

console-3: generate some traffic

mISDNuser/example/misdntestlayer1 --d --te
testlayer1 - card(0) debug(0) playload(1) btrans(0) testloop(0)
chan D  stream enabled with packet sz 64 bytes
--> D  -  PH_ACTIVATE_REQ
<-- D  -  PH_ACTIVATE_IND

waiting for data (use CTRL-C to cancel) stop(0) sleep(200)...
B1 rate/s: 0, rate-avg: 0.000, rx total: 0 kb since 0 secs, pkt(rx/tx): 0/0, rx-err:0,0
B2 rate/s: 0, rate-avg: 0.000, rx total: 0 kb since 0 secs, pkt(rx/tx): 0/0, rx-err:0,0
D  rate/s: 87448, rate-avg: 87436.896, rx total: 87448 kb since 1 secs, pkt(rx/tx): 1286/1287, rx-err:0,0

B1 rate/s: 0, rate-avg: 0.000, rx total: 0 kb since 0 secs, pkt(rx/tx): 0/0, rx-err:0,0
B2 rate/s: 0, rate-avg: 0.000, rx total: 0 kb since 0 secs, pkt(rx/tx): 0/0, rx-err:0,0
D  rate/s: 87584, rate-avg: 87506.681, rx total: 175032 kb since 2 secs, pkt(rx/tx): 2574/2575, rx-err:0,0