blob: 506cc3a2aa989ddbf4ec0b90bb5cec213ed66eaa [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-track
6"Insert a skeleton 4-integer-with-track event definition"
7nil
8'(setq function-name (skeleton-read "Function: "))
9'(setq track-label (skeleton-read "Track Label: "))
10'(setq label (skeleton-read "Label: "))
11
12"
13
14/* $$$ May or may not be needed */
15#include <vlib/vlib.h>
16#include <vppinfra/elog.h>
17
18static inline void " function-name " (u32 *data)
19{
20 ELOG_TYPE_DECLARE(e) =
21 {
22 .format = \"" label ": first %d second %d third %d fourth %d\",
23 .format_args = \"i4i4i4i4\",
24 };
25 struct { u32 data[4];} * ed;
26 ELOG_TRACK(" track-label ");
27 ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, " track-label ");
28 ed->data[0] = data[0];
29 ed->data[1] = data[1];
30 ed->data[2] = data[2];
31 ed->data[3] = data[3];
32}
33
34")