summaryrefslogtreecommitdiff
path: root/net/core/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/Makefile')
-rw-r--r--net/core/Makefile23
1 files changed, 22 insertions, 1 deletions
diff --git a/net/core/Makefile b/net/core/Makefile
index a8e4f737692b..e8ce3bd283a6 100644
--- a/net/core/Makefile
+++ b/net/core/Makefile
@@ -4,7 +4,8 @@
#
obj-y := sock.o request_sock.o skbuff.o datagram.o stream.o scm.o \
- gen_stats.o gen_estimator.o net_namespace.o secure_seq.o flow_dissector.o
+ gen_stats.o gen_estimator.o net_namespace.o secure_seq.o \
+ flow_dissector.o dropreason_str.o
obj-$(CONFIG_SYSCTL) += sysctl_net_core.o
@@ -39,3 +40,23 @@ obj-$(CONFIG_NET_SOCK_MSG) += skmsg.o
obj-$(CONFIG_BPF_SYSCALL) += sock_map.o
obj-$(CONFIG_BPF_SYSCALL) += bpf_sk_storage.o
obj-$(CONFIG_OF) += of_net.o
+
+clean-files := dropreason_str.c
+
+quiet_cmd_dropreason_str = GEN $@
+cmd_dropreason_str = awk -F ',' 'BEGIN{ print "\#include <net/dropreason.h>\n"; \
+ print "const char * const drop_reasons[] = {" }\
+ /^enum skb_drop/ { dr=1; }\
+ /^\};/ { dr=0; }\
+ /^\tSKB_DROP_REASON_/ {\
+ if (dr) {\
+ sub(/\tSKB_DROP_REASON_/, "", $$1);\
+ printf "\t[SKB_DROP_REASON_%s] = \"%s\",\n", $$1, $$1;\
+ }\
+ }\
+ END{ print "};" }' $< > $@
+
+$(obj)/dropreason_str.c: $(srctree)/include/net/dropreason.h
+ $(call cmd,dropreason_str)
+
+$(obj)/dropreason_str.o: $(obj)/dropreason_str.c