Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1617753imd; Thu, 1 Nov 2018 19:56:03 -0700 (PDT) X-Google-Smtp-Source: AJdET5dp4h8kXKHP15f7zxILcDcvGC0bJBUuA3NmzLaeLtl57l0GI1p3OlUz0UioUlBnsNZ5Zab5 X-Received: by 2002:a63:5f95:: with SMTP id t143mr9525843pgb.395.1541127363078; Thu, 01 Nov 2018 19:56:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541127363; cv=none; d=google.com; s=arc-20160816; b=aIFyhJ4bWOKhHDGgJOB+e14y45pVf5qy75B/hOPBXFK2bzUvFgrfLkr2nm7q7nsff3 HSPIncZK4g2ugvo0vRK1Ej4d1JNoiHmqj2/niNr8geVuXFCl7jyox5eDudiG6WchR5c5 mBPmI2Yv0+nnQOgtJsf61TpCBCxq3sFy5W1kophe/ZN6kUdi2CHCk7U1CSOrYDUC3cfb JwcHRxwRvqVjKiTnU+wdeRewWNYjffVELkWytOI+KtcCAzNbNmyhmv+JfB+F/Sj4P3wi fzAiHf+eb+eQ6OXZyRMbbcZ0sN8Tae0Hs6UZXvzE0MY/VAUHfjMdPz/Cxqo5gy+MtzIj LMww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=ajHK6QwGM4hdUBonR7VE7bp0bFAGXtY98Gw7V4EnCHM=; b=tYBzJiOdx6wAUHfw0366LKYxqtVClMR/waF1U60p8DQIoHR7kUMO4ZPrqfoE95MZmt jIkCK9XTkigTe1tvnuvyzeFehpn59zhdatMACpP1zttbhPyDHkJFNVdfKh+OfkiLknJl P+7uf5zUTNuBkXegQPzPMtiq42qJ7nv9hxcLqhJyz/jVf6/9Uwm8w215dhAkoCGV4WIc wYxuIbQS2x9KBj0RS5vh0rXsPPRgGOFf9iVTxk1NbFMFjvGYxvclm4Cv74EPvWFrqnUV Sx8+PeOuFzs29G8GFe5+yZUKDS/43fKlQvisTX49vjpIpg7wirjz5gyaWAHKL86OikSz cxnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QJyhUODW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n23-v6si23961270pgb.330.2018.11.01.19.55.45; Thu, 01 Nov 2018 19:56:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=QJyhUODW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726385AbeKBMA5 (ORCPT + 99 others); Fri, 2 Nov 2018 08:00:57 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:43147 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726229AbeKBMA4 (ORCPT ); Fri, 2 Nov 2018 08:00:56 -0400 Received: by mail-wr1-f66.google.com with SMTP id y3-v6so170792wrh.10 for ; Thu, 01 Nov 2018 19:55:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=ajHK6QwGM4hdUBonR7VE7bp0bFAGXtY98Gw7V4EnCHM=; b=QJyhUODW/gvwBQ2W1U8iDLCgEFZx9dimqhhEGNcJnQCON8uJ1i4SNrJMnqFqqtoILL c1f4X5QT5mDrFc58tk8lYvCuSlRfoDUiabUwX6VPv93xPW8jacpYVoRvdHQdnOHvs+Cd T9HN/akfqp7mjpi6oAlsFYvrXFN7R3QL2C1bQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=ajHK6QwGM4hdUBonR7VE7bp0bFAGXtY98Gw7V4EnCHM=; b=U6ODfCzEoqNdS8eHfX5qY2rPVwl2IcVVOziYIQDX2mYJkwwmZIlT1KOJHkZYSQsoTs +UDj+AVI/o8d++d8ih/GlcfKtalGGtJ+7v2GaQCYHLIr3v1scLAcLB0rUOhG5+KgGB5z KrLVRSFavVamRV7I79IAXL4fKY1F94JykFl04XV1fQZTekufmB5dErKW9wIXcPO2Sl++ NKmadqAdB44v3f77sJ+Cc9/DzCdDsa4EtN7shd5aDEl2IFW5ZsN2IIPHuQHFFLZ3DLsM whMG+WQ3gvdPAAvYkOlP4N/TjkS4wt8e1zrq8bBAwk4Q4FulVsYyf9luhat2zZ+nb/+l 6Vjw== X-Gm-Message-State: AGRZ1gKLDS6fCh/9d9JN7VvicnpOmvQ1cli/dCe4MCRo1eGi1840dMwF eYrCAEiNgEnE0PjEYV6h1HAW6AHFpK5bbg== X-Received: by 2002:a5d:4182:: with SMTP id m2-v6mr9195338wrp.8.1541127324376; Thu, 01 Nov 2018 19:55:24 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([209.250.228.18]) by smtp.gmail.com with ESMTPSA id l67-v6sm58180702wma.20.2018.11.01.19.55.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 19:55:23 -0700 (PDT) Date: Fri, 2 Nov 2018 10:55:16 +0800 From: leo.yan@linaro.org To: acme@redhat.com, Jiri Olsa , Mathieu Poirier Cc: Coresight ML , linux-kernel@vger.kernel.org Subject: Question: perf dso support for /proc/kallsyms Message-ID: <20181102025516.GA25374@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10+31 (9cdd884) (2018-06-19) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Now I found that if use the command 'perf script' for Arm CoreSight trace data, it fails to parse kernel symbols if we don't specify kernel vmlinux file. So when we don't specify kernel symbol files then perf tool will roll back to use /proc/kallsyms for kernel symbols parsing, as result it will run into below flow: thread__find_addr_map(thread, cpumode, MAP__FUNCTION, address, &al); map__load(al.map); dso__data_read_offset(al.map->dso, machine, offset, buffer, size); `-> data_read_offset() I can observe the function data_read_offset() returns failure, this is caused by checking the offset sanity "if (offset > dso->data.file_size)" (I pasted the whole function code at below in case you want to get more context for it), but if perf use "/proc/kallsyms" to load kernel symbols, the variable 'dso->data.file_size' will be set to zero thus the sanity checking always thinks the offset is out of the file size bound. Now I still don't understand how the dso/map support "/proc/kallsyms" and have no idea to fix this issue, though I spent some time to look into it. Could you give some suggestion for this? Or even better if you have fixing for this, I am glad to test at my side. static ssize_t data_read_offset(struct dso *dso, struct machine *machine, u64 offset, u8 *data, ssize_t size) { if (data_file_size(dso, machine)) return -1; /* Check the offset sanity. */ if (offset > dso->data.file_size) return -1; if (offset + size < offset) return -1; return cached_read(dso, machine, offset, data, size); } Thanks, Leo Yan