diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c index be2c134d672f..0a10bcc6ec95 100644 --- a/tools/perf/util/hist.c +++ b/tools/perf/util/hist.c @@ -484,7 +484,7 @@ static int hist_entry__init(struct hist_entry *he, goto err_infos; } - if (he->srcline) { + if (he->srcline && strcmp(he->srcline, SRCLINE_UNKNOWN)) { he->srcline = strdup(he->srcline); if (he->srcline == NULL) goto err_rawdata;