Skip to content

Commit

Permalink
Perf: fix build breakage
Browse files Browse the repository at this point in the history
[Patch not needed upstream as this is a backport build bugfix - gregkh

gcc correctly complains:

util/hist.c: In function ‘__hists__add_entry’:
util/hist.c:240:27: error: invalid type argument of ‘->’ (have ‘struct hist_entry’)
util/hist.c:241:23: error: invalid type argument of ‘->’ (have ‘struct hist_entry’)

for this new code:

+                       if (he->ms.map != entry->ms.map) {
+                               he->ms.map = entry->ms.map;
+                               if (he->ms.map)
+                                       he->ms.map->referenced = true;
+                       }

because "entry" is a "struct hist_entry", not a pointer to a struct.

In mainline, "entry" is a pointer to struct passed as argument to the function.
So this is broken during backporting. But obviously not compile tested.

Signed-off-by: Zeev Tarantov <[email protected]>
Cc: Signed-off-by: David S. Miller <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
zeevt authored and gregkh committed Apr 27, 2012
1 parent 41f45f5 commit 26cf838
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/perf/util/hist.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ struct hist_entry *__hists__add_entry(struct hists *self,
* mis-adjust symbol addresses when computing
* the history counter to increment.
*/
if (he->ms.map != entry->ms.map) {
he->ms.map = entry->ms.map;
if (he->ms.map != entry.ms.map) {
he->ms.map = entry.ms.map;
if (he->ms.map)
he->ms.map->referenced = true;
}
Expand Down

0 comments on commit 26cf838

Please sign in to comment.