diff options
author | Amerigo Wang <amwang@redhat.com> | 2012-11-07 22:42:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-11-08 22:06:36 -0500 |
commit | c1a6085195e832a6d14ac1e6cf601b884c38c71f (patch) | |
tree | 1811791a89d6880cc692ee7aa2f4f1ef8a7741ce /drivers/net/netconsole.c | |
parent | e949b09b71d975a82f13ac88ce4ad338fed213da (diff) |
netconsole: add oops_only module option
Some people wants to log only oops messages via netconsole,
(this is also why netoops was invented)
so add a module option for netconsole. This can be tuned
via /sys/module/netconsole/parameters/oops_only at run time
as well.
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netconsole.c')
-rw-r--r-- | drivers/net/netconsole.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index b3321129a83c..6989ebe2bc79 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c | |||
@@ -56,6 +56,10 @@ static char config[MAX_PARAM_LENGTH]; | |||
56 | module_param_string(netconsole, config, MAX_PARAM_LENGTH, 0); | 56 | module_param_string(netconsole, config, MAX_PARAM_LENGTH, 0); |
57 | MODULE_PARM_DESC(netconsole, " netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@<tgt-ip>/[tgt-macaddr]"); | 57 | MODULE_PARM_DESC(netconsole, " netconsole=[src-port]@[src-ip]/[dev],[tgt-port]@<tgt-ip>/[tgt-macaddr]"); |
58 | 58 | ||
59 | static bool oops_only = false; | ||
60 | module_param(oops_only, bool, 0600); | ||
61 | MODULE_PARM_DESC(oops_only, "Only log oops messages"); | ||
62 | |||
59 | #ifndef MODULE | 63 | #ifndef MODULE |
60 | static int __init option_setup(char *opt) | 64 | static int __init option_setup(char *opt) |
61 | { | 65 | { |
@@ -683,6 +687,8 @@ static void write_msg(struct console *con, const char *msg, unsigned int len) | |||
683 | struct netconsole_target *nt; | 687 | struct netconsole_target *nt; |
684 | const char *tmp; | 688 | const char *tmp; |
685 | 689 | ||
690 | if (oops_only && !oops_in_progress) | ||
691 | return; | ||
686 | /* Avoid taking lock and disabling interrupts unnecessarily */ | 692 | /* Avoid taking lock and disabling interrupts unnecessarily */ |
687 | if (list_empty(&target_list)) | 693 | if (list_empty(&target_list)) |
688 | return; | 694 | return; |