[PATCH] perf, tools: Fix WERROR=1 build with transction flags andfix browser

From: Andi Kleen
Date: Wed Oct 31 2012 - 05:02:35 EST



And one additional patch for this one to fix the WERROR=0 build again

---
- Fix the WERROR=1 build by avoiding some warnings
- Add a missing hunk to make the transaction flags display in the browser,
not only in --stdio

Signed-off-by: Andi Kleen <ak@xxxxxxxxxxxxxxx>

diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 5d20e11..41ddcf8 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -582,7 +582,7 @@ static inline char *add_str(char *p, const char *str)

static struct txbit {
unsigned flag;
- char *name;
+ const char *name;
} txbits[] = {
{ PERF_SAMPLE_TXN_ELISION, "EL " },
{ PERF_SAMPLE_TXN_TRANSACTION, "TX " },
@@ -593,7 +593,7 @@ static struct txbit {
{ PERF_SAMPLE_TXN_CAPACITY, "CAP " },
{ PERF_SAMPLE_TXN_MEMORY, "MEM " },
{ PERF_SAMPLE_TXN_MISC, "MISC " },
- {}
+ { 0, NULL }
};

static int hist_entry__transaction_snprintf(struct hist_entry *self, char *bf,
@@ -716,6 +716,8 @@ int sort_dimension__add(const char *tok)
sort__first_dimension = SORT_GLOBAL_WEIGHT;
else if (!strcmp(sd->name, "local_weight"))
sort__first_dimension = SORT_LOCAL_WEIGHT;
+ else if (!strcmp(sd->name, "transaction"))
+ sort__first_dimension = SORT_TRANSACTION;
}

list_add_tail(&sd->entry->list, &hist_entry__sort_list);
--
ak@xxxxxxxxxxxxxxx -- Speaking for myself only
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/