Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234802

Re: [PATCH 17/25] perf callchain: Allow for max_stack greater than PERF_MAX_STACK_DEPTH

From Adrian Hunter <adrian.hunter@intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 17/25] perf callchain: Allow for max_stack greater than PERF_MAX_STACK_DEPTH
Date 2015-09-29 10:20 +0200
Message-ID <qdYiK-Pt-9@gated-at.bofh.it> (permalink)
References <qcB4S-2t3-5@gated-at.bofh.it> <qcBez-2Eq-51@gated-at.bofh.it> <qdMUj-1fb-27@gated-at.bofh.it>
Organization Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki

Show all headers | View raw


On 28/09/15 23:08, Arnaldo Carvalho de Melo wrote:
> Em Fri, Sep 25, 2015 at 04:15:48PM +0300, Adrian Hunter escreveu:
>> Adjust the validation to allow for max_stack greater than
>> PERF_MAX_STACK_DEPTH.
>>
>> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
>> ---
>>  tools/perf/util/machine.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c
>> index fd1efeafb343..d7bd9a304535 100644
>> --- a/tools/perf/util/machine.c
>> +++ b/tools/perf/util/machine.c
>> @@ -1831,7 +1831,7 @@ static int thread__resolve_callchain_sample(struct thread *thread,
>>  	}
>>  
>>  check_calls:
>> -	if (chain->nr > PERF_MAX_STACK_DEPTH) {
>> +	if (chain->nr > PERF_MAX_STACK_DEPTH && (int)chain->nr > max_stack) {
> 
> Both?

Yes.

In the case of a hardware generated callchain, the callchain can be up to
PERF_MAX_STACK_DEPTH but max_stack can be less than PERF_MAX_STACK_DEPTH to
limit the number processed.

In the case of a synthesized callchain, the callchain can be up to max_stack
which might be more than PERF_MAX_STACK_DEPTH.

> 
>>  		pr_warning("corrupted callchain. skipping...\n");
>>  		return 0;
>>  	}
>> -- 
>> 1.9.1
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 17/25] perf callchain: Allow for max_stack greater than PERF_MAX_STACK_DEPTH Adrian Hunter <adrian.hunter@intel.com> - 2015-09-25 15:30 +0200
  Re: [PATCH 17/25] perf callchain: Allow for max_stack greater than  PERF_MAX_STACK_DEPTH Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-09-28 22:10 +0200
    Re: [PATCH 17/25] perf callchain: Allow for max_stack greater than  PERF_MAX_STACK_DEPTH Adrian Hunter <adrian.hunter@intel.com> - 2015-09-29 10:20 +0200
      Re: [PATCH 17/25] perf callchain: Allow for max_stack greater than  PERF_MAX_STACK_DEPTH Adrian Hunter <adrian.hunter@intel.com> - 2015-10-01 13:50 +0200
  [tip:perf/core] perf callchain:   Allow for max_stack greater than PERF_MAX_STACK_DEPTH tip-bot for Adrian Hunter <tipbot@zytor.com> - 2015-10-03 10:00 +0200

csiph-web