提交 f7e1e65d 编写于 作者: S Sebastian Ott 提交者: Martin Schwidefsky

s390: improve debug feature usage

The maximum usable buffer size of the s390 debug feature (when using
the sprintf_view) is 11 * sizeof(long) (1 pointer for the format
string + 10 arguments). When a larger buffer size is specified the
additional memory is unused and wasted per debug entry. So reducing
the buffer size to its maximum (or to the actual buffer size used)
will make more precious debug feature space usable.

For pci_msg, chsc_msg, and cio_crw we use the additional usable dbf
space to reduce the number of allocated pages.
Signed-off-by: NSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 fe7c30a4
...@@ -139,7 +139,7 @@ void zpci_debug_exit_device(struct zpci_dev *zdev) ...@@ -139,7 +139,7 @@ void zpci_debug_exit_device(struct zpci_dev *zdev)
int __init zpci_debug_init(void) int __init zpci_debug_init(void)
{ {
/* event trace buffer */ /* event trace buffer */
pci_debug_msg_id = debug_register("pci_msg", 16, 1, 16 * sizeof(long)); pci_debug_msg_id = debug_register("pci_msg", 8, 1, 8 * sizeof(long));
if (!pci_debug_msg_id) if (!pci_debug_msg_id)
return -EINVAL; return -EINVAL;
debug_register_view(pci_debug_msg_id, &debug_sprintf_view); debug_register_view(pci_debug_msg_id, &debug_sprintf_view);
......
...@@ -173,8 +173,7 @@ static struct css_driver chsc_subchannel_driver = { ...@@ -173,8 +173,7 @@ static struct css_driver chsc_subchannel_driver = {
static int __init chsc_init_dbfs(void) static int __init chsc_init_dbfs(void)
{ {
chsc_debug_msg_id = debug_register("chsc_msg", 16, 1, chsc_debug_msg_id = debug_register("chsc_msg", 8, 1, 4 * sizeof(long));
16 * sizeof(long));
if (!chsc_debug_msg_id) if (!chsc_debug_msg_id)
goto out; goto out;
debug_register_view(chsc_debug_msg_id, &debug_sprintf_view); debug_register_view(chsc_debug_msg_id, &debug_sprintf_view);
......
...@@ -54,7 +54,7 @@ debug_info_t *cio_debug_crw_id; ...@@ -54,7 +54,7 @@ debug_info_t *cio_debug_crw_id;
*/ */
static int __init cio_debug_init(void) static int __init cio_debug_init(void)
{ {
cio_debug_msg_id = debug_register("cio_msg", 16, 1, 16 * sizeof(long)); cio_debug_msg_id = debug_register("cio_msg", 16, 1, 11 * sizeof(long));
if (!cio_debug_msg_id) if (!cio_debug_msg_id)
goto out_unregister; goto out_unregister;
debug_register_view(cio_debug_msg_id, &debug_sprintf_view); debug_register_view(cio_debug_msg_id, &debug_sprintf_view);
...@@ -64,7 +64,7 @@ static int __init cio_debug_init(void) ...@@ -64,7 +64,7 @@ static int __init cio_debug_init(void)
goto out_unregister; goto out_unregister;
debug_register_view(cio_debug_trace_id, &debug_hex_ascii_view); debug_register_view(cio_debug_trace_id, &debug_hex_ascii_view);
debug_set_level(cio_debug_trace_id, 2); debug_set_level(cio_debug_trace_id, 2);
cio_debug_crw_id = debug_register("cio_crw", 16, 1, 16 * sizeof(long)); cio_debug_crw_id = debug_register("cio_crw", 8, 1, 8 * sizeof(long));
if (!cio_debug_crw_id) if (!cio_debug_crw_id)
goto out_unregister; goto out_unregister;
debug_register_view(cio_debug_crw_id, &debug_sprintf_view); debug_register_view(cio_debug_crw_id, &debug_sprintf_view);
......
...@@ -33,8 +33,8 @@ struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS] = { ...@@ -33,8 +33,8 @@ struct qeth_dbf_info qeth_dbf[QETH_DBF_INFOS] = {
/* N P A M L V H */ /* N P A M L V H */
[QETH_DBF_SETUP] = {"qeth_setup", [QETH_DBF_SETUP] = {"qeth_setup",
8, 1, 8, 5, &debug_hex_ascii_view, NULL}, 8, 1, 8, 5, &debug_hex_ascii_view, NULL},
[QETH_DBF_MSG] = {"qeth_msg", [QETH_DBF_MSG] = {"qeth_msg", 8, 1, 11 * sizeof(long), 3,
8, 1, 128, 3, &debug_sprintf_view, NULL}, &debug_sprintf_view, NULL},
[QETH_DBF_CTRL] = {"qeth_control", [QETH_DBF_CTRL] = {"qeth_control",
8, 1, QETH_DBF_CTRL_LEN, 5, &debug_hex_ascii_view, NULL}, 8, 1, QETH_DBF_CTRL_LEN, 5, &debug_hex_ascii_view, NULL},
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册