aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAli MJ Al-Nasrawy <alimjalnasrawy@gmail.com>2019-09-25 17:47:13 +0300
committerHauke Mehrtens <hauke@hauke-m.de>2019-10-12 23:51:29 +0200
commit10f5eb039854f1d81512f6a50b58756ea151c825 (patch)
treea59c3fb50e30b96fcc15710efb2cbb9ae7199526
parentc2635b871d1dd03a6608a9255222672decd49e09 (diff)
downloadupstream-10f5eb039854f1d81512f6a50b58756ea151c825.tar.gz
upstream-10f5eb039854f1d81512f6a50b58756ea151c825.tar.bz2
upstream-10f5eb039854f1d81512f6a50b58756ea151c825.zip
trelay: log "started" and "stopped"
It is informative especially when using multiple device pairs. Signed-off-by: Ali MJ Al-Nasrawy <alimjalnasrawy@gmail.com>
-rw-r--r--package/kernel/trelay/src/trelay.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/package/kernel/trelay/src/trelay.c b/package/kernel/trelay/src/trelay.c
index 3871ace070..1f14747597 100644
--- a/package/kernel/trelay/src/trelay.c
+++ b/package/kernel/trelay/src/trelay.c
@@ -20,6 +20,10 @@
#include <linux/rtnetlink.h>
#include <linux/debugfs.h>
+#define trelay_log(loglevel, tr, fmt, ...) \
+ printk(loglevel "trelay: %s <-> %s: " fmt "\n", \
+ tr->dev1->name, tr->dev2->name, ##__VA_ARGS__);
+
static LIST_HEAD(trelay_devs);
static struct dentry *debugfs_dir;
@@ -71,6 +75,8 @@ static int trelay_do_remove(struct trelay *tr)
netdev_rx_handler_unregister(tr->dev1);
netdev_rx_handler_unregister(tr->dev2);
+ trelay_log(KERN_INFO, tr, "stopped");
+
kfree(tr);
return 0;
@@ -183,6 +189,8 @@ static int trelay_do_add(char *name, char *devn1, char *devn2)
tr->dev2 = dev2;
list_add_tail(&tr->list, &trelay_devs);
+ trelay_log(KERN_INFO, tr, "started");
+
tr->debugfs = debugfs_create_dir(name, debugfs_dir);
debugfs_create_file("remove", S_IWUSR, tr->debugfs, tr, &fops_remove);
ret = 0;