Received: by 10.213.65.68 with SMTP id h4csp551118imn; Thu, 22 Mar 2018 03:25:42 -0700 (PDT) X-Google-Smtp-Source: AG47ELtJudjQOa6E/QcC/3YgeEv9njQR2HWygmw3kp1JjFCcce6hfrPVS7Eto/7yJ2ISM7f291Ay X-Received: by 2002:a17:902:51ad:: with SMTP id y42-v6mr21395649plh.314.1521714342207; Thu, 22 Mar 2018 03:25:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521714342; cv=none; d=google.com; s=arc-20160816; b=rEd7Ts5sBNuRxvCilV5BufAXwTT9xkOe+jGRiJVzPtaN+sScutzqpM20CQa5m7LBhd RuwKvqyYIb272RdMt52nduZE0/tJirQ5H3PIQB2SnO+UrLBnLH6G00Z1VaeohP2MzK/f pNJ8h1ZBvFjp927NeqU/upUZsXSTE9y2R0PLN1P1jq6OfAd+HDOJ98hu96ac/Xduszzf mffOkY1sbZOSstZM/G15A4g90FBE28DCrJxO/kLJO0ZXH9GV0FfFoj54AF8D8BsQv4U+ hzdaZ3iKdPgpBoA5/2NLN1Ze5yq13GyH6x8p6VJV29+aWXYE+aL1ODoZYzm6HZviL/Lb RqNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dmarc-filter:arc-authentication-results; bh=+g3ytPXvP6VLHIxcVlXU1UybMjjKBVKWPFbKXoVA8OY=; b=T6fv80ZP1BgcYdrO+dHEHUJ72TFhgJtUgqMX5h82HzZF8Elo6ok3AOsYlQHHTBjZRw GrZNtw5ZESt9hklmD8HT5KmTwYMgIubKWLeIxzmxEY2SvTqa2rPynqROtE+pJwyyz2gT 7Nbu3MhlosfUkMXX/0qtXqLJFozyZVcV6R/0S778BFxHmwR+frGKYrHnDEdZpqnssUVh T8GRGSBM4hDWICc6rtIob0ELqyrijc4LdPj+2HL/zQtkkxZyf0RR9mFHAG5fgMUUumbh OyNcHJUlq9BqKQx9aNbd4Bdga5nqQAh0jnM0GKeZmVRdsD4PJmRwvMOrcdwkwzlquLXr 5Jkg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t192si4292678pgb.595.2018.03.22.03.25.27; Thu, 22 Mar 2018 03:25:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754035AbeCVKX6 (ORCPT + 99 others); Thu, 22 Mar 2018 06:23:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:44484 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753342AbeCVKXx (ORCPT ); Thu, 22 Mar 2018 06:23:53 -0400 Received: from devnote (165084180235.ctinets.com [165.84.180.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E869B217D8; Thu, 22 Mar 2018 10:23:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E869B217D8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=mhiramat@kernel.org Date: Thu, 22 Mar 2018 18:23:47 +0800 From: Masami Hiramatsu To: Ravi Bangoria 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 Subject: Re: [PATCH v6 21/21] perf-probe: Add array argument support Message-Id: <20180322182347.ca1aab9b77ab4c351100646b@kernel.org> In-Reply-To: <8c02c538-4934-59c2-7795-9058ce57e625@linux.vnet.ibm.com> References: <152129024033.31874.15800253385376959274.stgit@devbox> <152129118998.31874.16273532808298489908.stgit@devbox> <8c02c538-4934-59c2-7795-9058ce57e625@linux.vnet.ibm.com> X-Mailer: Sylpheed 3.5.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 19 Mar 2018 13:29:59 +0530 Ravi Bangoria wrote: > Hi Masami, > > On 03/17/2018 06:23 PM, Masami Hiramatsu wrote: > > Since kprobes events support an array argument, perf-probe > > can also support dumping array now. > > The syntax are > > > > [] > > or > > [] > > > > where the is ... e.g. array[0..5]. > > This can also be available with string type. In this > > case, the string array should be "char *array[]" or > > "char **array_ptr". > > > > Note that this feature is only available on the kernel which > > supports array type. > > User can still do, > > # perf probe -x ~/hello main:3 'a=a:x32[3]' > > which will successfully be installed in uprobe_events. But for a > perf tool, x32[3] is not a valid type. And it seems perf tool don't > validate the 'type' field: > >     static int parse_perf_probe_arg(char *str, struct perf_probe_arg *arg) >     { >         .... >         tmp = strchr(str, ':'); >         if (tmp) {      /* Type setting */ >                 *tmp = '\0'; >                 arg->type = strdup(tmp + 1); >                 if (arg->type == NULL) >                         return -ENOMEM; >                 pr_debug("type:%s ", arg->type); >         } > > Is it okay to allow user to specify array size with type field? Fro this patch, yes. The availability of type is checked only when it is automatically generated. IMO, it should be done in another patch, something like "Validate user specified type casting" patch. Would you need it? Thank you, -- Masami Hiramatsu