blob: fda412a7bb82e4ddea4e2fd0dd447b99e20e3cea [file] [log] [blame]
Dave Barache5389bb2016-03-28 17:12:19 -04001;;; elog-4-int-skel.el - 4 integer elog skeleton
2
3(require 'skeleton)
4
5(define-skeleton skel-elog-4-int
6"Insert a skeleton 4-integer event definition"
7nil
8'(setq function-name (skeleton-read "Function: "))
9'(setq label (skeleton-read "Label: "))
10
11"
12
13/* $$$ May or may not be needed */
14#include <vlib/vlib.h>
15#include <vppinfra/elog.h>
16
17static inline void " function-name " (u32 *data)
18{
19 ELOG_TYPE_DECLARE(e) =
20 {
21 .format = \"" label ": first %d second %d third %d fourth %d\",
22 .format_args = \"i4i4i4i4\",
23 };
24 struct { u32 data[4];} * ed;
25 ed = ELOG_DATA (&vlib_global_main.elog_main, e);
26 ed->data[0] = data[0];
27 ed->data[1] = data[1];
28 ed->data[2] = data[2];
29 ed->data[3] = data[3];
30}
31")