Received: by 10.213.65.68 with SMTP id h4csp1444487imn; Wed, 14 Mar 2018 22:47:53 -0700 (PDT) X-Google-Smtp-Source: AG47ELtreq3XCo0GyaVqoGOqw5Lq0AyKZAWT/7NojALmFeVrPz0Vb2mcjeesRv9HN16l23wDdWI0 X-Received: by 10.101.96.65 with SMTP id b1mr3377534pgv.340.1521092873451; Wed, 14 Mar 2018 22:47:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521092873; cv=none; d=google.com; s=arc-20160816; b=c9nsfVf+nZsqOM1+snoETGmuGCG1kAv45SpJ7w1V+TlkqG60MuqQQM7nyZV9mY6/YK 5Vsw3bql3JW0w+Ez/t5eSbmieZe9dKqBJ4rznC9Bpxoeakesw2AQWwu3GEbDadYgPtsu K/hYrM0XDX7oZ1JCV46NVy5JpB30O7/2sHvK4JGAtMNC5h1CC2TQeaZSaRTiPA6ci7CA mPNAdZHPq26lGV8uQpRZ54FN55RAWCISErKSTzhI6SAxrasvDTTR3LAdbd3oeXtgJV2/ ATE3Bn8ISPibOcMZ7UDw5QTtgwLDkNDTBwhlGMWvwyLecnMwDCqdUx4hRjCSdcC4b6d1 pl6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=V8BNVKhzebNCTBSYJFMDpE0gHxCmOojpZdiLTlm88tY=; b=X7OGTUGT5PZfJmgkKn4oaBbcfi5ifi/lpdE6LCXikjtU6xKenRDtmC7fiBuPOUpX8b GNbcqkbSazIYii9s3ZYAjWc4HQMQXkb9+aNdjn46cP5yW1DKtx2L7uEbCxzXDcjqo0x8 7nZFbWGi3lYVeLXygOhE4u2FQIm7kL8onhWVs7GNNAJ9qCWWYGGdJYR/DUw8S9mFgXDr x6jBaRRLEg1s0rc4SiCkpiPEDbEbDBF/Wr/CNn+b52/WTCgyGTcrCbji2lCpgRAtWI5E XOojzUJr7VKwFOMf1hVQtJzf2HGQAdTaYGAKa++T0cBD54DmGNSPCFzhMYDo7PbkCn6J /fig== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1-v6si3360407plk.697.2018.03.14.22.47.27; Wed, 14 Mar 2018 22:47:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751551AbeCOFqE (ORCPT + 99 others); Thu, 15 Mar 2018 01:46:04 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37852 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751279AbeCOFqD (ORCPT ); Thu, 15 Mar 2018 01:46:03 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w2F5hX9Y048583 for ; Thu, 15 Mar 2018 01:46:02 -0400 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2gqjjv0r1h-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Thu, 15 Mar 2018 01:46:02 -0400 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 15 Mar 2018 05:45:59 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 15 Mar 2018 05:45:56 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w2F5jtAh19005594; Thu, 15 Mar 2018 05:45:55 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 67CDC52049; Thu, 15 Mar 2018 04:37:25 +0000 (GMT) Received: from [9.124.31.132] (unknown [9.124.31.132]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8AEB95203F; Thu, 15 Mar 2018 04:37:23 +0000 (GMT) Subject: Re: [PATCH v5 16/19] tracing: probeevent: Add array type support To: Masami Hiramatsu Cc: Steven Rostedt , linux-kernel@vger.kernel.org, Ingo Molnar , Namhyung Kim , Tom Zanussi , Arnaldo Carvalho de Melo , linux-trace-users@vger.kernel.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, Ravi Bangoria References: <152049860385.7289.14079393589900496424.stgit@devbox> <152049905133.7289.17516121776689315422.stgit@devbox> From: Ravi Bangoria Date: Thu, 15 Mar 2018 11:18:19 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <152049905133.7289.17516121776689315422.stgit@devbox> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18031505-0016-0000-0000-00000532CB4B X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18031505-0017-0000-0000-0000286FD370 Message-Id: <72be81a4-710a-b942-277d-9156c3debc5d@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-03-15_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1803150067 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Masami, On 03/08/2018 02:20 PM, Masami Hiramatsu wrote: > Add array type support for probe events. > This allows user to get arraied types from memory address. > The array type syntax is > > TYPE[N] > > Where TYPE is one of types (u8/16/32/64,s8/16/32/64, > x8/16/32/64, symbol, string) and N is a fixed value less > than 64. > > The string array type is a bit different from other types. For > other base types, [1] is equal to > (e.g. +0(%di):x32[1] is same as +0(%di):x32.) But string[1] is not > equal to string. The string type itself represents "char array", > but string array type represents "char * array". So, for example, > +0(%di):string[1] is equal to +0(+0(%di)):string. I was trying to test this patch. But I'm not getting proper data. Here is what I'm doing... $ cat hello.c #include void foo1(int a[]) {     printf("%d\n", a[2]); } void foo(int a[]) {     printf("%d\n", a[1]);     foo1(a); } void main() {     int a[3] = {4, 5, 6};     printf("%d\n", a[0]);     foo(a); } $ gcc -g hello.c -o hello $ sudo ./perf probe -x ~/hello foo1 'a=a:x32[3]' $ sudo cat /sys/kernel/debug/tracing/uprobe_events p:probe_hello/foo1 /home/ravi/hello:0x00000000000005fc a=+96(%gpr31):x32[3] $ sudo ./perf record -e probe_hello:foo1 ~/hello $ sudo ./perf script hello  6913 [038]  2857.704470: probe_hello:foo1: (100005fc) a={0xd69e4400,0x7fff,0x0} I don't see proper values of the 'a'? Anything wrong with my perf commands :) ? Thanks, Ravi