Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 20698f3

Browse files
committed
Show msg reg PRINT_CTX() only when DEBUG on
1 parent 1c09728 commit 20698f3

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ch7/show_kernel_seg/kernel_seg.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,16 +97,18 @@ static void show_userspace_info(void)
9797
#else // 32-bit
9898
"Above: TASK_SIZE = %lu size of userland [ %ld MB]\n"
9999
#endif
100-
" # userspace memory regions (VMAs) = %d\n"
101-
" Above statistics are wrt 'current' thread (see below):\n",
100+
" # userspace memory regions (VMAs) = %d\n",
102101
#if (BITS_PER_LONG == 64)
103102
TASK_SIZE, (TASK_SIZE >> 30),
104103
#else // 32-bit
105104
TASK_SIZE, (TASK_SIZE >> 20),
106105
#endif
107106
current->mm->map_count);
108107

108+
#ifdef DEBUG
109+
pr_info(" Above statistics are wrt 'current' thread (see below):\n");
109110
PRINT_CTX(); /* show which process is the one in context */
111+
#endif
110112
}
111113

112114
/*

0 commit comments

Comments
 (0)