--- /dev/null
+Bottom: 755378776a1eabd34e5c6e5a8ac9d7b31d4f94ce
+Top: c3e19d5c89c130c5826b49af075f2b7cff999eed
+Author: Sean Hefty <sean.hefty@intel.com>
+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 */