diff options
Diffstat (limited to 'build-root')
-rw-r--r-- | build-root/emacs-lisp/all-skel.el | 4 | ||||
-rw-r--r-- | build-root/emacs-lisp/elog-4-int-skel.el | 31 | ||||
-rw-r--r-- | build-root/emacs-lisp/elog-4-int-track-skel.el | 34 | ||||
-rw-r--r-- | build-root/emacs-lisp/elog-enum-skel.el | 35 | ||||
-rw-r--r-- | build-root/emacs-lisp/elog-one-datum-skel.el | 28 |
5 files changed, 132 insertions, 0 deletions
diff --git a/build-root/emacs-lisp/all-skel.el b/build-root/emacs-lisp/all-skel.el index fc961998070..2bf15b240f1 100644 --- a/build-root/emacs-lisp/all-skel.el +++ b/build-root/emacs-lisp/all-skel.el @@ -35,3 +35,7 @@ (load-file "./tunnel-decap-skel.el") (load-file "./tunnel-encap-skel.el") (load-file "./tunnel-h-skel.el") +(load-file "./elog-4-int-skel.el") +(load-file "./elog-4-int-track-skel.el") +(load-file "./elog-enum-skel.el") +(load-file "./elog-one-datum-skel.el") diff --git a/build-root/emacs-lisp/elog-4-int-skel.el b/build-root/emacs-lisp/elog-4-int-skel.el new file mode 100644 index 00000000000..fda412a7bb8 --- /dev/null +++ b/build-root/emacs-lisp/elog-4-int-skel.el @@ -0,0 +1,31 @@ +;;; elog-4-int-skel.el - 4 integer elog skeleton + +(require 'skeleton) + +(define-skeleton skel-elog-4-int +"Insert a skeleton 4-integer event definition" +nil +'(setq function-name (skeleton-read "Function: ")) +'(setq label (skeleton-read "Label: ")) + +" + +/* $$$ May or may not be needed */ +#include <vlib/vlib.h> +#include <vppinfra/elog.h> + +static inline void " function-name " (u32 *data) +{ + ELOG_TYPE_DECLARE(e) = + { + .format = \"" label ": first %d second %d third %d fourth %d\", + .format_args = \"i4i4i4i4\", + }; + struct { u32 data[4];} * ed; + ed = ELOG_DATA (&vlib_global_main.elog_main, e); + ed->data[0] = data[0]; + ed->data[1] = data[1]; + ed->data[2] = data[2]; + ed->data[3] = data[3]; +} +") diff --git a/build-root/emacs-lisp/elog-4-int-track-skel.el b/build-root/emacs-lisp/elog-4-int-track-skel.el new file mode 100644 index 00000000000..506cc3a2aa9 --- /dev/null +++ b/build-root/emacs-lisp/elog-4-int-track-skel.el @@ -0,0 +1,34 @@ +;;; elog-4-int-skel.el - 4 integer elog skeleton + +(require 'skeleton) + +(define-skeleton skel-elog-4-int-track +"Insert a skeleton 4-integer-with-track event definition" +nil +'(setq function-name (skeleton-read "Function: ")) +'(setq track-label (skeleton-read "Track Label: ")) +'(setq label (skeleton-read "Label: ")) + +" + +/* $$$ May or may not be needed */ +#include <vlib/vlib.h> +#include <vppinfra/elog.h> + +static inline void " function-name " (u32 *data) +{ + ELOG_TYPE_DECLARE(e) = + { + .format = \"" label ": first %d second %d third %d fourth %d\", + .format_args = \"i4i4i4i4\", + }; + struct { u32 data[4];} * ed; + ELOG_TRACK(" track-label "); + ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, " track-label "); + ed->data[0] = data[0]; + ed->data[1] = data[1]; + ed->data[2] = data[2]; + ed->data[3] = data[3]; +} + +") diff --git a/build-root/emacs-lisp/elog-enum-skel.el b/build-root/emacs-lisp/elog-enum-skel.el new file mode 100644 index 00000000000..836ce86a9d9 --- /dev/null +++ b/build-root/emacs-lisp/elog-enum-skel.el @@ -0,0 +1,35 @@ +;;; elog-enum-skel.el - enum elog skeleton + +(require 'skeleton) + +(define-skeleton skel-elog-enum +"Insert a skeleton enum event definition" +nil +'(setq function-name (skeleton-read "Function: ")) +'(setq label (skeleton-read "Label: ")) + +" + +/* $$$ May or may not be needed */ +#include <vlib/vlib.h> +#include <vppinfra/elog.h> + +static inline void " function-name " (u8 which) +{ + ELOG_TYPE_DECLARE (e) = + { + .format = \"" label ": %s\", + .format_args = \"t1\", + .n_enum_strings = 2, + .enum_strings = + { + \"string 1\", + \"string 2\", + }, + }; + struct { u8 which;} * ed; + ed = ELOG_DATA (&vlib_global_main.elog_main, e); + ed->which = which; +} + +") diff --git a/build-root/emacs-lisp/elog-one-datum-skel.el b/build-root/emacs-lisp/elog-one-datum-skel.el new file mode 100644 index 00000000000..11f8389619a --- /dev/null +++ b/build-root/emacs-lisp/elog-one-datum-skel.el @@ -0,0 +1,28 @@ +;;; elog-one-datum-skel.el - single u32 datum elog skeleton + +(require 'skeleton) + +(define-skeleton skel-elog-one-datum +"Insert a skeleton single datum event definition" +nil +'(setq function-name (skeleton-read "Function: ")) +'(setq label (skeleton-read "Label: ")) + +" + +/* $$$ May or may not be needed */ +#include <vlib/vlib.h> +#include <vppinfra/elog.h> + +static inline void " function-name " (u32 data) +{ + ELOG_TYPE_DECLARE (e) = + { + .format = \"" label ": %d\", + .format_args = \"i4\", + }; + + elog (&vlib_global_main.elog_main, &e, data); +} + +") |