From ac9685b2e090059f88199228d0d4a4554bcd8ed2 Mon Sep 17 00:00:00 2001 From: Sean Hefty Date: Tue, 9 Oct 2012 12:03:20 -0700 Subject: [PATCH] refresh (create temporary patch) --- meta | 5 +- patches/refresh-temp | 135 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 patches/refresh-temp diff --git a/meta b/meta index a795ed8..7c491e0 100644 --- a/meta +++ b/meta @@ -1,10 +1,11 @@ Version: 1 -Previous: 7688451684a532011b2c5f93803dd0ecc2f46642 -Head: 01626f2ad9fa59ba982b1fafbce2cefb8daa2d95 +Previous: 42d87e155d8aa16d42990f6cb8dec15d73699f14 +Head: d36cd1eb54e9a754c913faeea9dcaa51a6715a65 Applied: timeout: 2168f8cc0fe1a67b2565715ef0655866ce904a24 umask: d204fca2b6298d7799e918141ea8e11e7ad43cec acme: 01626f2ad9fa59ba982b1fafbce2cefb8daa2d95 + refresh-temp: d36cd1eb54e9a754c913faeea9dcaa51a6715a65 Unapplied: dev-name2ip: 8e00708e882239292492e13aa51c82042255933c dev-addrsize: 8de02c47fbf595132105a7050ad6f755f49f9a7a diff --git a/patches/refresh-temp b/patches/refresh-temp new file mode 100644 index 0000000..2271958 --- /dev/null +++ b/patches/refresh-temp @@ -0,0 +1,135 @@ +Bottom: 755378776a1eabd34e5c6e5a8ac9d7b31d4f94ce +Top: c3e19d5c89c130c5826b49af075f2b7cff999eed +Author: Sean Hefty +Date: 2012-10-09 12:03:20 -0700 + +Refresh of acme + +--- + +diff --git a/src/acme.c b/src/acme.c +index 4cd1a97..f0ff1e4 100644 +--- a/src/acme.c ++++ b/src/acme.c +@@ -55,7 +55,13 @@ static char *src_arg; + static char addr_type = 'u'; + static int verify; + static int nodelay; +-static int perf_query; ++ ++enum perf_query_output { ++ PERF_QUERY_NONE, ++ PERF_QUERY_ROW, ++ PERF_QUERY_COL ++}; ++static enum perf_query_outout perf_query; + int verbose; + + struct ibv_context **verbs; +@@ -667,6 +673,7 @@ static void resolve(char *svc) + + static void query_perf(char *svc) + { ++ static int lables; + int ret, cnt, i; + uint64_t *counters; + +@@ -676,10 +683,24 @@ static void query_perf(char *svc) + return; + } + +- printf("%s,", svc); +- for (i = 0; i < cnt - 1; i++) +- printf("%llu,", (unsigned long long) counters[i]); +- printf("%llu\n", (unsigned long long) counters[i]); ++ if (perf_query == PERF_QUERY_ROW) { ++ if (!lables) { ++ for (i = 0; i < cnt - 1; i++) ++ printf("%s,", ib_acm_cntr_name(i)); ++ printf("%s\n", ib_acm_cntr_namer(i)); ++ lables = 1; ++ } ++ printf("%s,", svc); ++ for (i = 0; i < cnt - 1; i++) ++ printf("%llu,", (unsigned long long) counters[i]); ++ printf("%llu\n", (unsigned long long) counters[i]); ++ } else { ++ printf("%s\n", svc); ++ for (i = 0; i < cnt; i++) { ++ printf("%s : ", ib_acm_cntr_name(i)); ++ printf("%llu\n", (unsigned long long) counters[i]); ++ } ++ } + ib_acm_free_perf(counters); + } + +@@ -694,11 +715,6 @@ static int query_svcs(void) + return -1; + } + +- if (perf_query) { +- printf("Destination,Error Count,Resolve Count,No Data,Addr Query Count," +- "Addr Cache Count,Route Query Count,Route Cache Count\n"); +- } +- + for (i = 0; svc_list[i]; i++) { + ret = ib_acm_connect(svc_list[i]); + if (ret) { +@@ -741,7 +757,7 @@ int CDECL_FUNC main(int argc, char **argv) + if (ret) + goto out; + +- while ((op = getopt(argc, argv, "f:s:d:vcA::O::D:PS:V")) != -1) { ++ while ((op = getopt(argc, argv, "f:s:d:vcA::O::D:P::S:V")) != -1) { + switch (op) { + case 'f': + addr_type = optarg[0]; +@@ -775,7 +791,10 @@ int CDECL_FUNC main(int argc, char **argv) + dest_dir = optarg; + break; + case 'P': +- perf_query = 1; ++ if (opt_arg(argc, argv) && !strnicmp("col", opt_arg(argv, argc), 3)) ++ perf_query = PERF_QUERY_COL; ++ else ++ perf_query = PERF_QUERY_ROW; + break; + case 'S': + svc_arg = optarg; +diff --git a/src/libacm.c b/src/libacm.c +index 5ca1abc..f912322 100644 +--- a/src/libacm.c ++++ b/src/libacm.c +@@ -357,3 +357,21 @@ out: + lock_release(&lock); + return ret; + } ++ ++const char *ib_acm_cntr_name(int index) ++{ ++ static const char *const cntr_name[] = { ++ [ACM_CNTR_ERROR] = "Error Count", ++ [ACM_CNTR_RESOLVE] = "Resolve Count", ++ [ACM_CNTR_NODATA] = "No Data", ++ [ACM_CNTR_ADDR_QUERY] = "Addr Query Count", ++ [ACM_CNTR_ADDR_CACHE] = "Addr Cache Count", ++ [ACM_CNTR_ROUTE_QUERY] = "Route Query Count", ++ [ACM_CNTR_ROUTE_CACHE] = "Route Cache Count", ++ }; ++ ++ if (index < ACM_CNTR_ERROR || index > ACM_CNTR_MAX) ++ return "Unknown"; ++ ++ return cntr_name[index]; ++} +diff --git a/src/libacm.h b/src/libacm.h +index 049b7a9..0334f60 100644 +--- a/src/libacm.h ++++ b/src/libacm.h +@@ -45,4 +45,6 @@ int ib_acm_resolve_path(struct ibv_path_record *path, uint32_t flags); + int ib_acm_query_perf(uint64_t **counters, int *count); + #define ib_acm_free_perf(counters) free(counters) + ++const char *ib_acm_cntr_name(int index) ++ + #endif /* LIBACM_H */ -- 2.41.0