diff options
author | Dave Barach <dave@barachs.net> | 2016-07-08 08:13:45 -0400 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-07-08 14:18:22 +0000 |
commit | 9b8ffd99fb35d37250cfb7094a0a31515f1bb577 (patch) | |
tree | 604ebcf86671a86b9e3395dda8d9fda50db2fcbc /vlib/vlib/elog_samples.c | |
parent | 0557a91ca727cee963a8179808d2d2108564ec56 (diff) |
fd-io-styleify pass
Change-Id: If2d57a213fc2fec996db26df332910c3d2105f97
Signed-off-by: Dave Barach <dave@barachs.net>
Diffstat (limited to 'vlib/vlib/elog_samples.c')
-rw-r--r-- | vlib/vlib/elog_samples.c | 92 |
1 files changed, 53 insertions, 39 deletions
diff --git a/vlib/vlib/elog_samples.c b/vlib/vlib/elog_samples.c index 0a5cd202252..a8c800df959 100644 --- a/vlib/vlib/elog_samples.c +++ b/vlib/vlib/elog_samples.c @@ -16,14 +16,17 @@ #include <vlib/vlib.h> #include <vppinfra/elog.h> -static inline void elog_four_int_sample (u32 *data) +static inline void +elog_four_int_sample (u32 * data) { - ELOG_TYPE_DECLARE(e) = - { - .format = "four int: first %d second %d third %d fourth %d", - .format_args = "i4i4i4i4", - }; - struct { u32 data[4];} * ed; + ELOG_TYPE_DECLARE (e) = + { + .format = "four int: 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]; @@ -31,15 +34,19 @@ static inline void elog_four_int_sample (u32 *data) ed->data[3] = data[3]; } -static inline void elog_four_int_track_sample (u32 *data) +static inline void +elog_four_int_track_sample (u32 * data) { - ELOG_TYPE_DECLARE(e) = - { - .format = "four_int_track: first %d second %d third %d fourth %d", - .format_args = "i4i4i4i4", - }; - struct { u32 data[4];} * ed; - ELOG_TRACK(sample_track); + ELOG_TYPE_DECLARE (e) = + { + .format = + "four_int_track: first %d second %d third %d fourth %d",.format_args = + "i4i4i4i4",}; + struct + { + u32 data[4]; + } *ed; + ELOG_TRACK (sample_track); ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, sample_track); ed->data[0] = data[0]; ed->data[1] = data[1]; @@ -47,39 +54,36 @@ static inline void elog_four_int_track_sample (u32 *data) ed->data[3] = data[3]; } -static inline void elog_enum_sample (u8 which) +static inline void +elog_enum_sample (u8 which) { - ELOG_TYPE_DECLARE (e) = + ELOG_TYPE_DECLARE (e) = + { + .format = "my enum: %s",.format_args = "t1",.n_enum_strings = + 2,.enum_strings = { - .format = "my enum: %s", - .format_args = "t1", - .n_enum_strings = 2, - .enum_strings = - { - "string 1", - "string 2", - }, - }; - struct { u8 which;} * ed; + "string 1", "string 2",},}; + struct + { + u8 which; + } *ed; ed = ELOG_DATA (&vlib_global_main.elog_main, e); ed->which = which; } -static inline void elog_one_datum_sample (u32 data) +static inline void +elog_one_datum_sample (u32 data) { - ELOG_TYPE_DECLARE (e) = - { - .format = "one datum: %d", - .format_args = "i4", - }; - + ELOG_TYPE_DECLARE (e) = + { + .format = "one datum: %d",.format_args = "i4",}; + elog (&vlib_global_main.elog_main, &e, data); } static clib_error_t * test_elog_command_fn (vlib_main_t * vm, - unformat_input_t * input, - vlib_cli_command_t * cmd) + unformat_input_t * input, vlib_cli_command_t * cmd) { int i; u32 samples[4]; @@ -87,9 +91,9 @@ test_elog_command_fn (vlib_main_t * vm, for (i = 0; i < 10; i++) { samples[0] = i; - samples[1] = i+1; - samples[2] = i+2; - samples[3] = i+3; + samples[1] = i + 1; + samples[2] = i + 2; + samples[3] = i + 3; elog_four_int_sample (samples); elog_four_int_track_sample (samples); @@ -101,8 +105,18 @@ test_elog_command_fn (vlib_main_t * vm, return 0; } +/* *INDENT-OFF* */ VLIB_CLI_COMMAND (test_elog_command, static) = { .path = "test elog sample", .short_help = "test elog sample", .function = test_elog_command_fn, }; +/* *INDENT-ON* */ + +/* + * fd.io coding-style-patch-verification: ON + * + * Local Variables: + * eval: (c-set-style "gnu") + * End: + */ |