Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
ae88de56
Commit
ae88de56
authored
Sep 16, 2019
by
Petr Mladek
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-5.4' into for-linus
parents
c9dccacf
085a3a8f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
21 deletions
+49
-21
Documentation/ABI/testing/dev-kmsg
Documentation/ABI/testing/dev-kmsg
+7
-8
kernel/printk/braille.c
kernel/printk/braille.c
+11
-4
kernel/printk/printk.c
kernel/printk/printk.c
+16
-6
lib/test_printf.c
lib/test_printf.c
+5
-0
lib/vsprintf.c
lib/vsprintf.c
+10
-3
No files found.
Documentation/ABI/testing/dev-kmsg
View file @
ae88de56
...
...
@@ -12,7 +12,7 @@ Description: The /dev/kmsg character device node provides userspace access
The logged line can be prefixed with a <N> syslog prefix, which
carries the syslog priority and facility. The single decimal
prefix number is composed of the 3 lowest bits being the syslog
priority and the
higher
bits the syslog facility number.
priority and the
next 8
bits the syslog facility number.
If no prefix is given, the priority number is the default kernel
log priority and the facility number is set to LOG_USER (1). It
...
...
@@ -90,13 +90,12 @@ Description: The /dev/kmsg character device node provides userspace access
+sound:card0 - subsystem:devname
The flags field carries '-' by default. A 'c' indicates a
fragment of a line. All following fragments are flagged with
'+'. Note, that these hints about continuation lines are not
necessarily correct, and the stream could be interleaved with
unrelated messages, but merging the lines in the output
usually produces better human readable results. A similar
logic is used internally when messages are printed to the
console, /proc/kmsg or the syslog() syscall.
fragment of a line. Note, that these hints about continuation
lines are not necessarily correct, and the stream could be
interleaved with unrelated messages, but merging the lines in
the output usually produces better human readable results. A
similar logic is used internally when messages are printed to
the console, /proc/kmsg or the syslog() syscall.
By default, kernel tries to avoid fragments by concatenating
when it can and fragments are rare; however, when extended
...
...
kernel/printk/braille.c
View file @
ae88de56
...
...
@@ -11,11 +11,18 @@
int
_braille_console_setup
(
char
**
str
,
char
**
brl_options
)
{
if
(
!
strncmp
(
*
str
,
"brl,"
,
4
))
{
size_t
len
;
len
=
str_has_prefix
(
*
str
,
"brl,"
);
if
(
len
)
{
*
brl_options
=
""
;
*
str
+=
4
;
}
else
if
(
!
strncmp
(
*
str
,
"brl="
,
4
))
{
*
brl_options
=
*
str
+
4
;
*
str
+=
len
;
return
0
;
}
len
=
str_has_prefix
(
*
str
,
"brl="
);
if
(
len
)
{
*
brl_options
=
*
str
+
len
;
*
str
=
strchr
(
*
brl_options
,
','
);
if
(
!*
str
)
{
pr_err
(
"need port name after brl=
\n
"
);
...
...
kernel/printk/printk.c
View file @
ae88de56
...
...
@@ -118,19 +118,29 @@ static unsigned int __read_mostly devkmsg_log = DEVKMSG_LOG_MASK_DEFAULT;
static
int
__control_devkmsg
(
char
*
str
)
{
size_t
len
;
if
(
!
str
)
return
-
EINVAL
;
if
(
!
strncmp
(
str
,
"on"
,
2
))
{
len
=
str_has_prefix
(
str
,
"on"
);
if
(
len
)
{
devkmsg_log
=
DEVKMSG_LOG_MASK_ON
;
return
2
;
}
else
if
(
!
strncmp
(
str
,
"off"
,
3
))
{
return
len
;
}
len
=
str_has_prefix
(
str
,
"off"
);
if
(
len
)
{
devkmsg_log
=
DEVKMSG_LOG_MASK_OFF
;
return
3
;
}
else
if
(
!
strncmp
(
str
,
"ratelimit"
,
9
))
{
return
len
;
}
len
=
str_has_prefix
(
str
,
"ratelimit"
);
if
(
len
)
{
devkmsg_log
=
DEVKMSG_LOG_MASK_DEFAULT
;
return
9
;
return
len
;
}
return
-
EINVAL
;
}
...
...
lib/test_printf.c
View file @
ae88de56
...
...
@@ -455,6 +455,11 @@ dentry(void)
test
(
"foo"
,
"%pd"
,
&
test_dentry
[
0
]);
test
(
"foo"
,
"%pd2"
,
&
test_dentry
[
0
]);
test
(
"(null)"
,
"%pd"
,
NULL
);
test
(
"(efault)"
,
"%pd"
,
PTR_INVALID
);
test
(
"(null)"
,
"%pD"
,
NULL
);
test
(
"(efault)"
,
"%pD"
,
PTR_INVALID
);
test
(
"romeo"
,
"%pd"
,
&
test_dentry
[
3
]);
test
(
"alfa/romeo"
,
"%pd2"
,
&
test_dentry
[
3
]);
test
(
"bravo/alfa/romeo"
,
"%pd3"
,
&
test_dentry
[
3
]);
...
...
lib/vsprintf.c
View file @
ae88de56
...
...
@@ -869,6 +869,15 @@ char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_sp
return
widen_string
(
buf
,
n
,
end
,
spec
);
}
static
noinline_for_stack
char
*
file_dentry_name
(
char
*
buf
,
char
*
end
,
const
struct
file
*
f
,
struct
printf_spec
spec
,
const
char
*
fmt
)
{
if
(
check_pointer
(
&
buf
,
end
,
f
,
spec
))
return
buf
;
return
dentry_name
(
buf
,
end
,
f
->
f_path
.
dentry
,
spec
,
fmt
);
}
#ifdef CONFIG_BLOCK
static
noinline_for_stack
char
*
bdev_name
(
char
*
buf
,
char
*
end
,
struct
block_device
*
bdev
,
...
...
@@ -2166,9 +2175,7 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
case
'C'
:
return
clock
(
buf
,
end
,
ptr
,
spec
,
fmt
);
case
'D'
:
return
dentry_name
(
buf
,
end
,
((
const
struct
file
*
)
ptr
)
->
f_path
.
dentry
,
spec
,
fmt
);
return
file_dentry_name
(
buf
,
end
,
ptr
,
spec
,
fmt
);
#ifdef CONFIG_BLOCK
case
'g'
:
return
bdev_name
(
buf
,
end
,
ptr
,
spec
,
fmt
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment