diff options
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/s390/s390dbf.txt | 79 |
1 files changed, 46 insertions, 33 deletions
diff --git a/Documentation/s390/s390dbf.txt b/Documentation/s390/s390dbf.txt index 2d1cd939b4df..e24fdeada970 100644 --- a/Documentation/s390/s390dbf.txt +++ b/Documentation/s390/s390dbf.txt | |||
@@ -12,8 +12,8 @@ where log records can be stored efficiently in memory, where each component | |||
12 | One purpose of this is to inspect the debug logs after a production system crash | 12 | One purpose of this is to inspect the debug logs after a production system crash |
13 | in order to analyze the reason for the crash. | 13 | in order to analyze the reason for the crash. |
14 | If the system still runs but only a subcomponent which uses dbf failes, | 14 | If the system still runs but only a subcomponent which uses dbf failes, |
15 | it is possible to look at the debug logs on a live system via the Linux proc | 15 | it is possible to look at the debug logs on a live system via the Linux |
16 | filesystem. | 16 | debugfs filesystem. |
17 | The debug feature may also very useful for kernel and driver development. | 17 | The debug feature may also very useful for kernel and driver development. |
18 | 18 | ||
19 | Design: | 19 | Design: |
@@ -52,16 +52,18 @@ Each debug entry contains the following data: | |||
52 | - Flag, if entry is an exception or not | 52 | - Flag, if entry is an exception or not |
53 | 53 | ||
54 | The debug logs can be inspected in a live system through entries in | 54 | The debug logs can be inspected in a live system through entries in |
55 | the proc-filesystem. Under the path /proc/s390dbf there is | 55 | the debugfs-filesystem. Under the toplevel directory "s390dbf" there is |
56 | a directory for each registered component, which is named like the | 56 | a directory for each registered component, which is named like the |
57 | corresponding component. | 57 | corresponding component. The debugfs normally should be mounted to |
58 | /sys/kernel/debug therefore the debug feature can be accessed unter | ||
59 | /sys/kernel/debug/s390dbf. | ||
58 | 60 | ||
59 | The content of the directories are files which represent different views | 61 | The content of the directories are files which represent different views |
60 | to the debug log. Each component can decide which views should be | 62 | to the debug log. Each component can decide which views should be |
61 | used through registering them with the function debug_register_view(). | 63 | used through registering them with the function debug_register_view(). |
62 | Predefined views for hex/ascii, sprintf and raw binary data are provided. | 64 | Predefined views for hex/ascii, sprintf and raw binary data are provided. |
63 | It is also possible to define other views. The content of | 65 | It is also possible to define other views. The content of |
64 | a view can be inspected simply by reading the corresponding proc file. | 66 | a view can be inspected simply by reading the corresponding debugfs file. |
65 | 67 | ||
66 | All debug logs have an an actual debug level (range from 0 to 6). | 68 | All debug logs have an an actual debug level (range from 0 to 6). |
67 | The default level is 3. Event and Exception functions have a 'level' | 69 | The default level is 3. Event and Exception functions have a 'level' |
@@ -69,14 +71,14 @@ parameter. Only debug entries with a level that is lower or equal | |||
69 | than the actual level are written to the log. This means, when | 71 | than the actual level are written to the log. This means, when |
70 | writing events, high priority log entries should have a low level | 72 | writing events, high priority log entries should have a low level |
71 | value whereas low priority entries should have a high one. | 73 | value whereas low priority entries should have a high one. |
72 | The actual debug level can be changed with the help of the proc-filesystem | 74 | The actual debug level can be changed with the help of the debugfs-filesystem |
73 | through writing a number string "x" to the 'level' proc file which is | 75 | through writing a number string "x" to the 'level' debugfs file which is |
74 | provided for every debug log. Debugging can be switched off completely | 76 | provided for every debug log. Debugging can be switched off completely |
75 | by using "-" on the 'level' proc file. | 77 | by using "-" on the 'level' debugfs file. |
76 | 78 | ||
77 | Example: | 79 | Example: |
78 | 80 | ||
79 | > echo "-" > /proc/s390dbf/dasd/level | 81 | > echo "-" > /sys/kernel/debug/s390dbf/dasd/level |
80 | 82 | ||
81 | It is also possible to deactivate the debug feature globally for every | 83 | It is also possible to deactivate the debug feature globally for every |
82 | debug log. You can change the behavior using 2 sysctl parameters in | 84 | debug log. You can change the behavior using 2 sysctl parameters in |
@@ -99,11 +101,11 @@ Kernel Interfaces: | |||
99 | ------------------ | 101 | ------------------ |
100 | 102 | ||
101 | ---------------------------------------------------------------------------- | 103 | ---------------------------------------------------------------------------- |
102 | debug_info_t *debug_register(char *name, int pages_index, int nr_areas, | 104 | debug_info_t *debug_register(char *name, int pages, int nr_areas, |
103 | int buf_size); | 105 | int buf_size); |
104 | 106 | ||
105 | Parameter: name: Name of debug log (e.g. used for proc entry) | 107 | Parameter: name: Name of debug log (e.g. used for debugfs entry) |
106 | pages_index: 2^pages_index pages will be allocated per area | 108 | pages: number of pages, which will be allocated per area |
107 | nr_areas: number of debug areas | 109 | nr_areas: number of debug areas |
108 | buf_size: size of data area in each debug entry | 110 | buf_size: size of data area in each debug entry |
109 | 111 | ||
@@ -134,7 +136,7 @@ Return Value: none | |||
134 | Description: Sets new actual debug level if new_level is valid. | 136 | Description: Sets new actual debug level if new_level is valid. |
135 | 137 | ||
136 | --------------------------------------------------------------------------- | 138 | --------------------------------------------------------------------------- |
137 | +void debug_stop_all(void); | 139 | void debug_stop_all(void); |
138 | 140 | ||
139 | Parameter: none | 141 | Parameter: none |
140 | 142 | ||
@@ -270,7 +272,7 @@ Parameter: id: handle for debug log | |||
270 | Return Value: 0 : ok | 272 | Return Value: 0 : ok |
271 | < 0: Error | 273 | < 0: Error |
272 | 274 | ||
273 | Description: registers new debug view and creates proc dir entry | 275 | Description: registers new debug view and creates debugfs dir entry |
274 | 276 | ||
275 | --------------------------------------------------------------------------- | 277 | --------------------------------------------------------------------------- |
276 | int debug_unregister_view (debug_info_t * id, struct debug_view *view); | 278 | int debug_unregister_view (debug_info_t * id, struct debug_view *view); |
@@ -281,7 +283,7 @@ Parameter: id: handle for debug log | |||
281 | Return Value: 0 : ok | 283 | Return Value: 0 : ok |
282 | < 0: Error | 284 | < 0: Error |
283 | 285 | ||
284 | Description: unregisters debug view and removes proc dir entry | 286 | Description: unregisters debug view and removes debugfs dir entry |
285 | 287 | ||
286 | 288 | ||
287 | 289 | ||
@@ -308,7 +310,7 @@ static int init(void) | |||
308 | { | 310 | { |
309 | /* register 4 debug areas with one page each and 4 byte data field */ | 311 | /* register 4 debug areas with one page each and 4 byte data field */ |
310 | 312 | ||
311 | debug_info = debug_register ("test", 0, 4, 4 ); | 313 | debug_info = debug_register ("test", 1, 4, 4 ); |
312 | debug_register_view(debug_info,&debug_hex_ascii_view); | 314 | debug_register_view(debug_info,&debug_hex_ascii_view); |
313 | debug_register_view(debug_info,&debug_raw_view); | 315 | debug_register_view(debug_info,&debug_raw_view); |
314 | 316 | ||
@@ -343,7 +345,7 @@ static int init(void) | |||
343 | /* register 4 debug areas with one page each and data field for */ | 345 | /* register 4 debug areas with one page each and data field for */ |
344 | /* format string pointer + 2 varargs (= 3 * sizeof(long)) */ | 346 | /* format string pointer + 2 varargs (= 3 * sizeof(long)) */ |
345 | 347 | ||
346 | debug_info = debug_register ("test", 0, 4, sizeof(long) * 3); | 348 | debug_info = debug_register ("test", 1, 4, sizeof(long) * 3); |
347 | debug_register_view(debug_info,&debug_sprintf_view); | 349 | debug_register_view(debug_info,&debug_sprintf_view); |
348 | 350 | ||
349 | debug_sprintf_event(debug_info, 2 , "first event in %s:%i\n",__FILE__,__LINE__); | 351 | debug_sprintf_event(debug_info, 2 , "first event in %s:%i\n",__FILE__,__LINE__); |
@@ -362,16 +364,16 @@ module_exit(cleanup); | |||
362 | 364 | ||
363 | 365 | ||
364 | 366 | ||
365 | ProcFS Interface | 367 | Debugfs Interface |
366 | ---------------- | 368 | ---------------- |
367 | Views to the debug logs can be investigated through reading the corresponding | 369 | Views to the debug logs can be investigated through reading the corresponding |
368 | proc-files: | 370 | debugfs-files: |
369 | 371 | ||
370 | Example: | 372 | Example: |
371 | 373 | ||
372 | > ls /proc/s390dbf/dasd | 374 | > ls /sys/kernel/debug/s390dbf/dasd |
373 | flush hex_ascii level raw | 375 | flush hex_ascii level pages raw |
374 | > cat /proc/s390dbf/dasd/hex_ascii | sort +1 | 376 | > cat /sys/kernel/debug/s390dbf/dasd/hex_ascii | sort +1 |
375 | 00 00974733272:680099 2 - 02 0006ad7e 07 ea 4a 90 | .... | 377 | 00 00974733272:680099 2 - 02 0006ad7e 07 ea 4a 90 | .... |
376 | 00 00974733272:682210 2 - 02 0006ade6 46 52 45 45 | FREE | 378 | 00 00974733272:682210 2 - 02 0006ade6 46 52 45 45 | FREE |
377 | 00 00974733272:682213 2 - 02 0006adf6 07 ea 4a 90 | .... | 379 | 00 00974733272:682213 2 - 02 0006adf6 07 ea 4a 90 | .... |
@@ -391,25 +393,36 @@ Changing the debug level | |||
391 | Example: | 393 | Example: |
392 | 394 | ||
393 | 395 | ||
394 | > cat /proc/s390dbf/dasd/level | 396 | > cat /sys/kernel/debug/s390dbf/dasd/level |
395 | 3 | 397 | 3 |
396 | > echo "5" > /proc/s390dbf/dasd/level | 398 | > echo "5" > /sys/kernel/debug/s390dbf/dasd/level |
397 | > cat /proc/s390dbf/dasd/level | 399 | > cat /sys/kernel/debug/s390dbf/dasd/level |
398 | 5 | 400 | 5 |
399 | 401 | ||
400 | Flushing debug areas | 402 | Flushing debug areas |
401 | -------------------- | 403 | -------------------- |
402 | Debug areas can be flushed with piping the number of the desired | 404 | Debug areas can be flushed with piping the number of the desired |
403 | area (0...n) to the proc file "flush". When using "-" all debug areas | 405 | area (0...n) to the debugfs file "flush". When using "-" all debug areas |
404 | are flushed. | 406 | are flushed. |
405 | 407 | ||
406 | Examples: | 408 | Examples: |
407 | 409 | ||
408 | 1. Flush debug area 0: | 410 | 1. Flush debug area 0: |
409 | > echo "0" > /proc/s390dbf/dasd/flush | 411 | > echo "0" > /sys/kernel/debug/s390dbf/dasd/flush |
410 | 412 | ||
411 | 2. Flush all debug areas: | 413 | 2. Flush all debug areas: |
412 | > echo "-" > /proc/s390dbf/dasd/flush | 414 | > echo "-" > /sys/kernel/debug/s390dbf/dasd/flush |
415 | |||
416 | Changing the size of debug areas | ||
417 | ------------------------------------ | ||
418 | It is possible the change the size of debug areas through piping | ||
419 | the number of pages to the debugfs file "pages". The resize request will | ||
420 | also flush the debug areas. | ||
421 | |||
422 | Example: | ||
423 | |||
424 | Define 4 pages for the debug areas of debug feature "dasd": | ||
425 | > echo "4" > /sys/kernel/debug/s390dbf/dasd/pages | ||
413 | 426 | ||
414 | Stooping the debug feature | 427 | Stooping the debug feature |
415 | -------------------------- | 428 | -------------------------- |
@@ -491,7 +504,7 @@ Defining views | |||
491 | -------------- | 504 | -------------- |
492 | 505 | ||
493 | Views are specified with the 'debug_view' structure. There are defined | 506 | Views are specified with the 'debug_view' structure. There are defined |
494 | callback functions which are used for reading and writing the proc files: | 507 | callback functions which are used for reading and writing the debugfs files: |
495 | 508 | ||
496 | struct debug_view { | 509 | struct debug_view { |
497 | char name[DEBUG_MAX_PROCF_LEN]; | 510 | char name[DEBUG_MAX_PROCF_LEN]; |
@@ -525,7 +538,7 @@ typedef int (debug_input_proc_t) (debug_info_t* id, | |||
525 | The "private_data" member can be used as pointer to view specific data. | 538 | The "private_data" member can be used as pointer to view specific data. |
526 | It is not used by the debug feature itself. | 539 | It is not used by the debug feature itself. |
527 | 540 | ||
528 | The output when reading a debug-proc file is structured like this: | 541 | The output when reading a debugfs file is structured like this: |
529 | 542 | ||
530 | "prolog_proc output" | 543 | "prolog_proc output" |
531 | 544 | ||
@@ -534,13 +547,13 @@ The output when reading a debug-proc file is structured like this: | |||
534 | "header_proc output 3" "format_proc output 3" | 547 | "header_proc output 3" "format_proc output 3" |
535 | ... | 548 | ... |
536 | 549 | ||
537 | When a view is read from the proc fs, the Debug Feature calls the | 550 | When a view is read from the debugfs, the Debug Feature calls the |
538 | 'prolog_proc' once for writing the prolog. | 551 | 'prolog_proc' once for writing the prolog. |
539 | Then 'header_proc' and 'format_proc' are called for each | 552 | Then 'header_proc' and 'format_proc' are called for each |
540 | existing debug entry. | 553 | existing debug entry. |
541 | 554 | ||
542 | The input_proc can be used to implement functionality when it is written to | 555 | The input_proc can be used to implement functionality when it is written to |
543 | the view (e.g. like with 'echo "0" > /proc/s390dbf/dasd/level). | 556 | the view (e.g. like with 'echo "0" > /sys/kernel/debug/s390dbf/dasd/level). |
544 | 557 | ||
545 | For header_proc there can be used the default function | 558 | For header_proc there can be used the default function |
546 | debug_dflt_header_fn() which is defined in in debug.h. | 559 | debug_dflt_header_fn() which is defined in in debug.h. |
@@ -602,7 +615,7 @@ debug_info = debug_register ("test", 0, 4, 4 )); | |||
602 | debug_register_view(debug_info, &debug_test_view); | 615 | debug_register_view(debug_info, &debug_test_view); |
603 | for(i = 0; i < 10; i ++) debug_int_event(debug_info, 1, i); | 616 | for(i = 0; i < 10; i ++) debug_int_event(debug_info, 1, i); |
604 | 617 | ||
605 | > cat /proc/s390dbf/test/myview | 618 | > cat /sys/kernel/debug/s390dbf/test/myview |
606 | 00 00964419734:611402 1 - 00 88042ca This error........... | 619 | 00 00964419734:611402 1 - 00 88042ca This error........... |
607 | 00 00964419734:611405 1 - 00 88042ca That error........... | 620 | 00 00964419734:611405 1 - 00 88042ca That error........... |
608 | 00 00964419734:611408 1 - 00 88042ca Problem.............. | 621 | 00 00964419734:611408 1 - 00 88042ca Problem.............. |