summaryrefslogtreecommitdiffstats
path: root/.gitignore
AgeCommit message (Expand)AuthorFilesLines
2020-05-08misc: add knob to generate compile_commands.jsonDamjan Marion1-0/+4
2020-04-28gomemif: introduce gomemifJakub Grajciar1-0/+2
2019-12-04build: fix make test with distributed srcDave Wallace1-4/+0
2019-10-17misc: Update gitignore for /test/ext/.dNeale Ranns1-0/+1
2019-10-09docs: Add macos build documentationNathan Skrzypczak1-0/+3
2019-06-18misc: vpp_papi- add tests, clean up pep8Paul Vinciguerra1-0/+3
2019-02-20Remove autotools leftovers from gitignoreBenoît Ganne1-2/+0
2018-11-29make test: create virtualenv under /test/Klement Sekera1-3/+3
2018-09-28gitignore: build/external/downloadsFlorin Coras1-1/+2
2018-09-24Add the sphinx docs build optionsjdenisco1-1/+1
2018-09-20rename vpp-dpdk-dev to vpp-ext-depsDamjan Marion1-4/+4
2018-08-17CMake as an alternative to autotools (experimental)Damjan Marion1-1/+0
2018-07-27Fix .gitignore so docs/Makefile is not ignored. Add README and Makefile. Fis ...John DeNisco1-0/+1
2018-07-26Initial commit of Sphinx docsJohn DeNisco1-0/+2
2018-06-22Python API: Add enum and union support.Ole Troan1-2/+0
2018-06-21Add .pydevproject to .gitignoreMarek Gradzki1-0/+1
2018-06-18Revert "Python API: Add enum and union support."Ole Trøan1-0/+2
2018-06-17Python API: Add enum and union support.Ole Troan1-2/+0
2018-05-31Add src/vlib/config.h.in templateDamjan Marion1-1/+0
2018-03-15remove bootstrap from top-level MakefileDamjan Marion1-1/+1
2018-03-15use system provided ccache linksDamjan Marion1-1/+0
2018-02-07Update gitignore for cmakeKeith Burns (alagalah)1-0/+2
2017-12-15Ignore core filesKeith Burns (alagalah)1-0/+3
2017-12-04Optimize RPM build processRenato Botelho do Couto1-0/+2
2017-11-01VPP Object Model (VOM)Neale Ranns1-0/+1
2017-09-19Add new C APIKlement Sekera1-0/+1
2017-09-08gitignore update for IDEKeith Burns (alagalah)1-1/+2
2017-09-07Allow individual stats API and introduce stats.apiKeith Burns (alagalah)1-0/+1
2017-08-29Add .pybuild to gitignoreKeith Burns (alagalah)1-0/+1
2017-08-22Update gitignore for DPDK filesKeith Burns (alagalah)1-0/+2
2017-01-13vppctl: new bash completion for vppctl commandsPadraig Connolly1-0/+3
2017-01-01Move java,lua api and remaining plugins to src/Damjan Marion1-5/+5
2016-12-09Add make test code coverage reporting using gcovJuraj Sloboda1-0/+1
2016-11-22GRE tests and fixesNeale Ranns1-0/+3
2016-11-01fix typo in .gitignoreKlement Sekera1-1/+1
2016-10-31add vpp debugging support to test frameworkKlement Sekera1-0/+2
2016-10-25Add generated python bindings to .gitignoreMarek Gradzki1-0/+5
2016-09-21A Protocol Independent Hierarchical FIB (VPP-352)Neale Ranns1-2/+2
2016-08-31VPP-221 CLI auto-documentation infrastructureChris Luke1-0/+3
2016-08-30VPP-364 Add vpp-api/python/build to gitignoreFlorin Coras1-0/+2
2016-08-25VPP Python language binding - plugin supportOle Troan1-2/+2
2016-08-16Create python package for jvpp generation.Ed Warnicke1-0/+3
2016-08-12VPP-237: Checkstyle script to check for new checkstyle breakageEd Warnicke1-0/+3
2016-07-21Updating gitignore for generated plugins folderKeith Burns (alagalah)1-0/+1
2016-06-19gitignore gtagsKeith Burns (alagalah)1-0/+4
2016-06-14gitignore change due to DPDK download suffix changeKeith Burns (alagalah)1-0/+1
2016-05-13VPP-57 Add Doxygen to VPPChris Luke1-0/+3
2016-05-12Generate jvpp sources in build-rootMaros Marsalek1-5/+0
2016-05-02HONEYCOMB-10: jVpp - the new java API. C code and jar file generationMarek Gradzki1-0/+6
2016-04-24Updated .gitignore for Python API generated fileKeith Burns (alagalah)1-0/+1
d i; for (i = 0; i < vec_len (v); i++) { if (i > 0) s = format (s, ", "); s = format (s, fmt, v[i]); } return s; } u8 * format_vec_uword (u8 * s, va_list * va) { uword *v = va_arg (*va, uword *); char *fmt = va_arg (*va, char *); uword i; for (i = 0; i < vec_len (v); i++) { if (i > 0) s = format (s, ", "); s = format (s, fmt, v[i]); } return s; } /* Ascii buffer and length. */ u8 * format_ascii_bytes (u8 * s, va_list * va) { u8 *v = va_arg (*va, u8 *); uword n_bytes = va_arg (*va, uword); vec_add (s, v, n_bytes); return s; } /* Format hex dump. */ u8 * format_hex_bytes (u8 * s, va_list * va) { u8 *bytes = va_arg (*va, u8 *); int n_bytes = va_arg (*va, int); uword i; /* Print short or long form depending on byte count. */ uword short_form = n_bytes <= 32; u32 indent = format_get_indent (s); if (n_bytes == 0) return s; for (i = 0; i < n_bytes; i++) { if (!short_form && (i % 32) == 0) s = format (s, "%08x: ", i); s = format (s, "%02x", bytes[i]); if (!short_form && ((i + 1) % 32) == 0 && (i + 1) < n_bytes) s = format (s, "\n%U", format_white_space, indent); } return s; } u8 * format_hex_bytes_no_wrap (u8 * s, va_list * va) { u8 *bytes = va_arg (*va, u8 *); int n_bytes = va_arg (*va, int); uword i; if (n_bytes == 0) return s; for (i = 0; i < n_bytes; i++) s = format (s, "%02x", bytes[i]); return s; } /* Add variable number of spaces. */ u8 * format_white_space (u8 * s, va_list * va) { u32 n = va_arg (*va, u32); while (n-- > 0) vec_add1 (s, ' '); return s; } u8 * format_duration (u8 *s, va_list *args) { f64 t = va_arg (*args, f64); s = format (s, ""); const f64 seconds_per_minute = 60; const f64 seconds_per_hour = 60 * seconds_per_minute; const f64 seconds_per_day = 24 * seconds_per_hour; uword days, hours, minutes, secs, msecs, usecs; days = t / seconds_per_day; t -= days * seconds_per_day; hours = t / seconds_per_hour; t -= hours * seconds_per_hour; minutes = t / seconds_per_minute; t -= minutes * seconds_per_minute; secs = t; t -= secs; msecs = 1e3 * t; usecs = 1e6 * t; usecs = usecs % 1000; if (t == 0.) s = format (s, "0"); if (days) s = format (s, "%ddays ", days); if (hours) s = format (s, "%dh ", hours); if (minutes) s = format (s, "%dmin ", minutes); if (secs) s = format (s, "%ds ", secs); if (msecs) s = format (s, "%dms ", msecs); if (usecs) s = format (s, "%dus", usecs); return (s); } u8 * format_time_interval (u8 * s, va_list * args) { u8 *fmt = va_arg (*args, u8 *); f64 t = va_arg (*args, f64); u8 *f; const f64 seconds_per_minute = 60; const f64 seconds_per_hour = 60 * seconds_per_minute; const f64 seconds_per_day = 24 * seconds_per_hour; uword days, hours, minutes, secs, msecs, usecs; days = t / seconds_per_day; t -= days * seconds_per_day; hours = t / seconds_per_hour; t -= hours * seconds_per_hour; minutes = t / seconds_per_minute; t -= minutes * seconds_per_minute; secs = t; t -= secs; msecs = 1e3 * t; usecs = 1e6 * t; for (f = fmt; *f; f++) { uword what, c; char *what_fmt = "%d"; switch (c = *f) { default: vec_add1 (s, c); continue; case 'd': what = days; what_fmt = "%d"; break; case 'h': what = hours; what_fmt = "%02d"; break; case 'm': what = minutes; what_fmt = "%02d"; break; case 's': what = secs; what_fmt = "%02d"; break; case 'f': what = msecs; what_fmt = "%03d"; break; case 'u': what = usecs; what_fmt = "%06d"; break; } s = format (s, what_fmt, what); } return s; } /* Format base 10 e.g. 100, 100K, 100M, 100G */ __clib_export u8 * format_base10 (u8 *s, va_list *va) { u64 size = va_arg (*va, u64); if (size < 1000) s = format (s, "%d", size); else if (size < 1000000) s = format (s, "%.2fK", (f64) size / 1000.); else if (size < 1000000000) s = format (s, "%.2fM", (f64) size / 1000000.); else s = format (s, "%.2fG", (f64) size / 1000000000.); return s; } /* Unparse memory size e.g. 100, 100k, 100m, 100g. */ __clib_export u8 * format_memory_size (u8 * s, va_list * va) { uword size = va_arg (*va, uword); uword l, u, log_u; l = size > 0 ? min_log2 (size) : 0; if (l < 10) log_u = 0; else if (l < 20) log_u = 10; else if (l < 30) log_u = 20; else log_u = 30; u = (uword) 1 << log_u; if (size & (u - 1)) s = format (s, "%.2f", (f64) size / (f64) u); else s = format (s, "%d", size >> log_u); if (log_u != 0) s = format (s, "%c", " kmg"[log_u / 10]); return s; } /* Parse memory size e.g. 100, 100k, 100m, 100g. */ __clib_export uword unformat_memory_size (unformat_input_t * input, va_list * va) { uword amount, shift, c; uword *result = va_arg (*va, uword *); if (!unformat (input, "%wd%_", &amount)) return 0; c = unformat_get_input (input); switch (c) { case 'k': case 'K': shift = 10; break; case 'm': case 'M': shift = 20; break; case 'g': case 'G': shift = 30; break; default: shift = 0; unformat_put_input (input); break; } *result = amount << shift; return 1; } /* Unparse memory page size e.g. 4K, 2M */ __clib_export u8 * format_log2_page_size (u8 * s, va_list * va) { clib_mem_page_sz_t log2_page_sz = va_arg (*va, clib_mem_page_sz_t); if (log2_page_sz == CLIB_MEM_PAGE_SZ_UNKNOWN) return format (s, "unknown"); if (log2_page_sz == CLIB_MEM_PAGE_SZ_DEFAULT) return format (s, "default"); if (log2_page_sz == CLIB_MEM_PAGE_SZ_DEFAULT_HUGE) return format (s, "default-hugepage"); if (log2_page_sz >= 30) return format (s, "%uG", 1 << (log2_page_sz - 30)); if (log2_page_sz >= 20) return format (s, "%uM", 1 << (log2_page_sz - 20)); if (log2_page_sz >= 10) return format (s, "%uK", 1 << (log2_page_sz - 10)); return format (s, "%u", 1 << log2_page_sz); } /* Parse memory page size e.g. 4K, 2M */ __clib_export uword unformat_log2_page_size (unformat_input_t * input, va_list * va) { uword amount; clib_mem_page_sz_t *result = va_arg (*va, clib_mem_page_sz_t *); if (unformat (input, "default-hugepage")) *result = CLIB_MEM_PAGE_SZ_DEFAULT_HUGE; else if (unformat (input, "default")) *result = CLIB_MEM_PAGE_SZ_DEFAULT; else if (unformat (input, "%wdk", &amount)) *result = min_log2 (amount) + 10; else if (unformat (input, "%wdK", &amount)) *result = min_log2 (amount) + 10; else if (unformat (input, "%wdm", &amount)) *result = min_log2 (amount) + 20; else if (unformat (input, "%wdM", &amount)) *result = min_log2 (amount) + 20; else if (unformat (input, "%wdg", &amount)) *result = min_log2 (amount) + 30; else if (unformat (input, "%wdG", &amount)) *result = min_log2 (amount) + 30; else return 0; return 1; } /* Format c identifier: e.g. a_name -> "a name". Works for both vector names and null terminated c strings. */ __clib_export u8 * format_c_identifier (u8 * s, va_list * va) { u8 *id = va_arg (*va, u8 *); uword i, l; l = ~0; if (id) for (i = 0; i < l && id[i] != 0; i++) { u8 c = id[i]; if (c == '_') c = ' '; vec_add1 (s, c); } return s; } __clib_export u8 * format_hexdump (u8 * s, va_list * args) { u8 *data = va_arg (*args, u8 *); uword len = va_arg (*args, uword); int i, index = 0; const int line_len = 16; u8 *line_hex = 0; u8 *line_str = 0; u32 indent = format_get_indent (s); if (!len) return s; for (i = 0; i < len; i++) { line_hex = format (line_hex, "%02x ", data[i]); line_str = format (line_str, "%c", isprint (data[i]) ? data[i] : '.'); if (!((i + 1) % line_len)) { s = format (s, "%U%05x: %v[%v]", format_white_space, index ? indent : 0, index, line_hex, line_str); if (i < len - 1) s = format (s, "\n"); index = i + 1; vec_reset_length (line_hex); vec_reset_length (line_str); } } while (i++ % line_len) line_hex = format (line_hex, " "); if (vec_len (line_hex)) s = format (s, "%U%05x: %v[%v]", format_white_space, index ? indent : 0, index, line_hex, line_str); vec_free (line_hex); vec_free (line_str); return s; } __clib_export u8 * format_hexdump_u16 (u8 *s, va_list *args) { u16 *data = va_arg (*args, u16 *); u32 len = va_arg (*args, u32); u32 indent = format_get_indent (s); if (!len) return s; for (int i = 0; i < len; i++) { if (i % 8 == 0) { s = format (s, "%s%U%05x: ", i ? "\n" : "", format_white_space, i ? indent : 0, i * 2); } s = format (s, " %04lx", data[i]); } return s; } __clib_export u8 * format_hexdump_u32 (u8 *s, va_list *args) { u32 *data = va_arg (*args, u32 *); u32 len = va_arg (*args, u32); u32 indent = format_get_indent (s); if (!len) return s; for (int i = 0; i < len; i++) { if (i % 4 == 0) { s = format (s, "%s%U%05x: ", i ? "\n" : "", format_white_space, i ? indent : 0, i * 4); } s = format (s, " %08lx", data[i]); } return s; } __clib_export u8 * format_hexdump_u64 (u8 *s, va_list *args) { u64 *data = va_arg (*args, u64 *); u32 len = va_arg (*args, u32); u32 indent = format_get_indent (s); if (!len) return s; for (int i = 0; i < len; i++) { if (i % 2 == 0) { s = format (s, "%s%U%05x: ", i ? "\n" : "", format_white_space, i ? indent : 0, i * 8); } s = format (s, " %016lx", data[i]); } return s; } __clib_export u8 * format_uword_bitmap (u8 *s, va_list *args) { uword *bitmap = va_arg (*args, uword *); int n_uword = va_arg (*args, int); uword indent = format_get_indent (s); s = format (s, "%6s", ""); for (int i = uword_bits - 4; i >= 0; i -= 4) s = format (s, "%5d", i); vec_add1 (s, '\n'); for (int j = n_uword - 1; j >= 0; j--) { s = format (s, "%U0x%04x ", format_white_space, indent, j * uword_bits / 8); for (int i = uword_bits - 1; i >= 0; i--) { vec_add1 (s, (1ULL << i) & bitmap[j] ? '1' : '.'); if (i % 4 == 0) vec_add1 (s, ' '); } s = format (s, uword_bits == 64 ? "0x%016lx" : "0x%08lx", bitmap[j]); if (j) vec_add1 (s, '\n'); } return s; } /* * fd.io coding-style-patch-verification: ON * * Local Variables: * eval: (c-set-style "gnu") * End: */