Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1360497pxx; Tue, 27 Oct 2020 15:05:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwu2UEaTRrR+2KESCSPMoOsYjqGVPNJ9QTbOjzHT31xHRQ/snUggjZlcOzit+oNL0OVaHCS X-Received: by 2002:a05:6402:cac:: with SMTP id cn12mr4500765edb.326.1603836342054; Tue, 27 Oct 2020 15:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603836342; cv=none; d=google.com; s=arc-20160816; b=XhQwxb5/64ROBBJ/yqNPvPmub9HQqrtk3I300ZKFl0PRZBaxJdPICW7BovPFGiY2tc AKRhkBKpUa/KRu3PuhA1pO9l8Mrpc/kQxMhVLlaCdKDuWoa1Fs+EMnVptzBqT0M8Lame ABms2uzsFTKfDlczVr8IbADcoUHG/EX7Mp37rg0bTeiiiGuT0RRmrkkwiwPzl+Q85wbN +gLu/87ZM3+3l6AJSDnfztZguDbx0lVYHGKBXairWyZGKdS4CQ9C2eLygR4g+p9GDThi Mgcq0cSAL1770cDSMjoHD2a0QhsNyy3dVHibK2Cwj8yiBx1BURXO681ZkU7wnUpmNJc1 5pRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ngPKTvR1IpSlXKqEEPPICpOA1ws2tSXxni49kU0D+Mk=; b=Aq3fwwiEM1CF/KY9gSVIHhevkCFWzyceNJhT/RDez8crov2e0LpyOfJ1ZsUvy3uWKv 9jtxMEio7CAmlVMB7Piko5Zmfx/Wx7Dw0aF0wTZnHVSsMxoI+CXxvNyHakIqmvCUaXen 5in/PEhHiPCn+nnp4/dMM/ihT74mCCyhWdXAQ4ImknUaKd+5ZeDENDD+VTkvDQwpw1Ch U/KWseSsauLuJWKSdaz0LjTjQiKRpikOWe04j/awVcR3DyLDYX7H80w0f4Mc2Cfh9BLy IC9cciQM5RUOpY/3LtUEFXz7IqXXWc5ZAOQS6iEGF/umBG8Yz3EojVmJvlm8GLunfFL8 LKGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eZuYmrB1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a61si1674132edf.418.2020.10.27.15.04.55; Tue, 27 Oct 2020 15:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eZuYmrB1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2505746AbgJ0FKz (ORCPT + 99 others); Tue, 27 Oct 2020 01:10:55 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36606 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2505741AbgJ0FKz (ORCPT ); Tue, 27 Oct 2020 01:10:55 -0400 Received: by mail-wr1-f67.google.com with SMTP id x7so410305wrl.3; Mon, 26 Oct 2020 22:10:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ngPKTvR1IpSlXKqEEPPICpOA1ws2tSXxni49kU0D+Mk=; b=eZuYmrB1kcNwArGQsuuXGjT3KdyjReayS4/LwD2Mb+Pk7R8lq+9g3y8EqkiKMqGcZh O0DloQFiv+i5+AJMlLkH8iXF4a5cWhXO+EYmoxAQgqUUVFQq+mjNEr1M8toatk+lEuji Lv0kGbqMdoV+891IB9tdhnfn6XUwiD19EHeF20tx97uuzBMo0Dn8BywydaXvWLrufX9c wPZ6BbWW9Leiq18xpchJx0DHNN20GtMoig6dQOvIpt16tPKmmxvh5rbHhNUgWXWvHdZM v7U2s1GbUM0ZClb+sWJBmsYu0FB+kTj2ingvTUwdr3239WRpt77ef23ajwOhgQCQpPbH gGRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ngPKTvR1IpSlXKqEEPPICpOA1ws2tSXxni49kU0D+Mk=; b=aM0Jo7bs8SXmbOQqZ6eQYbHQmfKs1CGqi3uln9uFoNxZP+YaxkS7Y/bhujbTH6h88P igy++Vi3v5+jml7ZLD5JCg7uVhOygPF4RLmyW3q1WCRBcAhQEYz53CJI36rCrTqk9ws9 A9lVni/fHv9Z0XB1jOedCGzicui8mPZLbO5/xnz0ErE94JFnScc750Xavkbgt7wwhRJn 3vKn0vGJOjAjvmkSlet3G0wTrP54wVAwg6rtmw7kPp8mAVorfXgQM0eqzfNr3QSbhK0c clG81VrstjQusqF/7AQCTqxoRkaSoy+P++PXiVygLLfThragUzbRavOiE1CwET5ppk89 eorw== X-Gm-Message-State: AOAM530IBszTXNnpDacQL1RYBfAl1fageujDxx52Wx2enV9UU4d5vBfS 77GD9/jH8RxXIeOpX5swgaev3GvaJsa2+Bof2ks= X-Received: by 2002:adf:a345:: with SMTP id d5mr562792wrb.55.1603775452893; Mon, 26 Oct 2020 22:10:52 -0700 (PDT) MIME-Version: 1.0 References: <20201026132034.80464-1-sivanichkin@yandex-team.ru> In-Reply-To: <20201026132034.80464-1-sivanichkin@yandex-team.ru> From: Namhyung Kim Date: Tue, 27 Oct 2020 14:10:42 +0900 Message-ID: Subject: Re: [PATCH v2] perf trace: Segfault when trying to trace events by cgroup To: Stanislav Ivanichkin Cc: linux-kernel , linux-perf-users , Dmitry Monakhov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On Mon, Oct 26, 2020 at 10:21 PM Stanislav Ivanichkin wrote: > > v2: > - struct declaration fixed (Namhyung Kim) > > Fixes: 9ea42ba4411ac ("perf trace: Support setting cgroups as targets") > Signed-off-by: Stanislav Ivanichkin Looks ok but you'd better add the commit description in v1. Acked-by: Namhyung Kim Thanks Namhyung > --- > tools/perf/builtin-trace.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) > > diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c > index 44a75f234db1..de80534473af 100644 > --- a/tools/perf/builtin-trace.c > +++ b/tools/perf/builtin-trace.c > @@ -4639,9 +4639,9 @@ static int trace__parse_events_option(const struct option *opt, const char *str, > err = 0; > > if (lists[0]) { > - struct option o = OPT_CALLBACK('e', "event", &trace->evlist, "event", > - "event selector. use 'perf list' to list available events", > - parse_events_option); > + struct option o = { > + .value = &trace->evlist, > + }; > err = parse_events_option(&o, lists[0], 0); > } > out: > @@ -4655,9 +4655,12 @@ static int trace__parse_cgroups(const struct option *opt, const char *str, int u > { > struct trace *trace = opt->value; > > - if (!list_empty(&trace->evlist->core.entries)) > - return parse_cgroups(opt, str, unset); > - > + if (!list_empty(&trace->evlist->core.entries)) { > + struct option o = { > + .value = &trace->evlist, > + }; > + return parse_cgroups(&o, str, unset); > + } > trace->cgroup = evlist__findnew_cgroup(trace->evlist, str); > > return 0; > -- > 2.17.1 >