Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
xenomai
ipipe-ppc32
Commits
b7d2654e
Commit
b7d2654e
authored
Sep 09, 2018
by
Philippe Gerum
Browse files
printk: ipipe: defer vprintk() output
parent
8e0a6efa
Changes
1
Hide whitespace changes
Inline
Side-by-side
kernel/printk/printk.c
View file @
b7d2654e
...
...
@@ -1923,44 +1923,6 @@ asmlinkage int vprintk_emit(int facility, int level,
}
EXPORT_SYMBOL
(
vprintk_emit
);
asmlinkage
int
vprintk
(
const
char
*
fmt
,
va_list
args
)
{
return
vprintk_func
(
fmt
,
args
);
}
EXPORT_SYMBOL
(
vprintk
);
asmlinkage
int
printk_emit
(
int
facility
,
int
level
,
const
char
*
dict
,
size_t
dictlen
,
const
char
*
fmt
,
...)
{
va_list
args
;
int
r
;
va_start
(
args
,
fmt
);
r
=
vprintk_emit
(
facility
,
level
,
dict
,
dictlen
,
fmt
,
args
);
va_end
(
args
);
return
r
;
}
EXPORT_SYMBOL
(
printk_emit
);
int
vprintk_default
(
const
char
*
fmt
,
va_list
args
)
{
int
r
;
#ifdef CONFIG_KGDB_KDB
/* Allow to pass printk() to kdb but avoid a recursion. */
if
(
unlikely
(
kdb_trap_printk
&&
kdb_printf_cpu
<
0
))
{
r
=
vkdb_printf
(
KDB_MSGSRC_PRINTK
,
fmt
,
args
);
return
r
;
}
#endif
r
=
vprintk_emit
(
0
,
LOGLEVEL_DEFAULT
,
NULL
,
0
,
fmt
,
args
);
return
r
;
}
EXPORT_SYMBOL_GPL
(
vprintk_default
);
#ifdef CONFIG_IPIPE
extern
int
__ipipe_printk_bypass
;
...
...
@@ -2020,37 +1982,12 @@ start:
raw_spin_unlock_irqrestore
(
&
__ipipe_printk_lock
,
flags
);
}
/**
* printk - print a kernel message
* @fmt: format string
*
* This is printk(). It can be called from any context. We want it to work.
*
* We try to grab the console_lock. If we succeed, it's easy - we log the
* output and call the console drivers. If we fail to get the semaphore, we
* place the output into the log buffer and return. The current holder of
* the console_sem will notice the new output in console_unlock(); and will
* send it to the consoles before releasing the lock.
*
* One effect of this deferred printing is that code which calls printk() and
* then changes console_loglevel may break. This is because console_loglevel
* is inspected when the actual printing occurs.
*
* See also:
* printf(3)
*
* See the vsnprintf() documentation for format string extensions over C99.
*/
asmlinkage
__visible
int
printk
(
const
char
*
fmt
,
...)
static
int
do_vprintk
(
const
char
*
fmt
,
va_list
args
)
{
int
sprintk
=
1
,
cs
=
-
1
;
unsigned
long
flags
;
va_list
args
;
int
ret
;
va_start
(
args
,
fmt
);
flags
=
hard_local_irq_save
();
if
(
__ipipe_printk_bypass
||
oops_in_progress
)
...
...
@@ -2072,27 +2009,88 @@ asmlinkage __visible int printk(const char *fmt, ...)
}
else
ret
=
__ipipe_log_printk
(
fmt
,
args
);
va_end
(
args
);
return
ret
;
}
#else
/* !CONFIG_IPIPE */
asmlinkage
__visible
int
printk
(
const
char
*
fmt
,
...)
static
int
do_vprintk
(
const
char
*
fmt
,
va_list
args
)
{
return
vprintk_func
(
fmt
,
args
);
}
#endif
/* !CONFIG_IPIPE */
asmlinkage
int
vprintk
(
const
char
*
fmt
,
va_list
args
)
{
return
do_vprintk
(
fmt
,
args
);
}
EXPORT_SYMBOL
(
vprintk
);
asmlinkage
int
printk_emit
(
int
facility
,
int
level
,
const
char
*
dict
,
size_t
dictlen
,
const
char
*
fmt
,
...)
{
va_list
args
;
int
r
;
va_start
(
args
,
fmt
);
r
=
vprintk_
func
(
fmt
,
args
);
r
=
vprintk_
emit
(
facility
,
level
,
dict
,
dictlen
,
fmt
,
args
);
va_end
(
args
);
return
r
;
}
EXPORT_SYMBOL
(
printk_emit
);
int
vprintk_default
(
const
char
*
fmt
,
va_list
args
)
{
int
r
;
#ifdef CONFIG_KGDB_KDB
/* Allow to pass printk() to kdb but avoid a recursion. */
if
(
unlikely
(
kdb_trap_printk
&&
kdb_printf_cpu
<
0
))
{
r
=
vkdb_printf
(
KDB_MSGSRC_PRINTK
,
fmt
,
args
);
return
r
;
}
#endif
r
=
vprintk_emit
(
0
,
LOGLEVEL_DEFAULT
,
NULL
,
0
,
fmt
,
args
);
return
r
;
}
EXPORT_SYMBOL_GPL
(
vprintk_default
);
/**
* printk - print a kernel message
* @fmt: format string
*
* This is printk(). It can be called from any context. We want it to work.
*
* We try to grab the console_lock. If we succeed, it's easy - we log the
* output and call the console drivers. If we fail to get the semaphore, we
* place the output into the log buffer and return. The current holder of
* the console_sem will notice the new output in console_unlock(); and will
* send it to the consoles before releasing the lock.
*
* One effect of this deferred printing is that code which calls printk() and
* then changes console_loglevel may break. This is because console_loglevel
* is inspected when the actual printing occurs.
*
* See also:
* printf(3)
*
* See the vsnprintf() documentation for format string extensions over C99.
*/
asmlinkage
__visible
int
printk
(
const
char
*
fmt
,
...)
{
va_list
args
;
int
r
;
#endif
/* CONFIG_IPIPE */
va_start
(
args
,
fmt
);
r
=
do_vprintk
(
fmt
,
args
);
va_end
(
args
);
return
r
;
}
EXPORT_SYMBOL
(
printk
);
#else
/* CONFIG_PRINTK */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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