Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp158884pxa; Wed, 26 Aug 2020 07:22:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3oDNXGu1n9z14KumiJCgGWJDNL4MW0QHuH9UGIBleEHjLGcAxCofgCsYaz+g17jeMkjCh X-Received: by 2002:a17:906:25d3:: with SMTP id n19mr15278077ejb.551.1598451746569; Wed, 26 Aug 2020 07:22:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598451746; cv=none; d=google.com; s=arc-20160816; b=pV4ryZInUboTujr0NPGNCf31GrwxF7l+Dt4YWJ2OSBlPoRY4n/Qc88Aw/TGnqgDaIP W45fZMMT9C/47dXRpbeOYC2Z9l6p0opLD+EvYHoGv4E4gtH18aophWbrOZ4WVD3afn2V n+ZvtTPFU8OXYs8e4GdxFuPH2ifDH/ay3SypGA390KpQUefzn0LLsQww1rE5IVc53bwg rYAQYuMFO9/BEZx+7Q31Zl8+34IulLj2uRl1FAUEn8OnaXB17s/gBqsm6i3kvCcxiRXU IVfG9haShxkIqxZuuXc2OR48034c9zEOs43aNaVGpbjkQsBQ7ng4/xwVDS7rgguP5jea Pdgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=NgLSMjRHWPLLE0TzbEBLz1QQLMzRlMx2WrSWoJBXSIA=; b=l+pLvNJlZkjSAhcK9E3sbtK6ZZZdYxwk3VrW3fatdhj12dBM+hJD4g9cuf6i6Tfr7G QAY3M1HB4EAKpcuXU1DamKb02bPuzS9gEM/DUB/k+SSxAXubKlO7PE4Ni8mhXTWLlZBj 4W4K1szOha0dbp+dGevVXfCoK08/HDHt0c5W1wQqS8luJNKIAa4ju+cBxJK9qhA2grVi wvBpKE8OehiqVTZsynAp1NOZyuFrYFpyMk+CJmLyflEmbT+bcgc+tpnYOedCeEzFoHhr jAYziMIyWrQHSlRG3MP3F/qXhAmR5CFAZ2j4SJjPqNRmIJVqPwvJX19p02ouR37hQSay M7nQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=J6xLMitE; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id va2si1727766ejb.14.2020.08.26.07.22.03; Wed, 26 Aug 2020 07:22:26 -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=@redhat.com header.s=mimecast20190719 header.b=J6xLMitE; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728567AbgHZLCN (ORCPT + 99 others); Wed, 26 Aug 2020 07:02:13 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31782 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728803AbgHZK5P (ORCPT ); Wed, 26 Aug 2020 06:57:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598439434; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NgLSMjRHWPLLE0TzbEBLz1QQLMzRlMx2WrSWoJBXSIA=; b=J6xLMitEESkJv+PdUTfXtmH7Bogfq9vf++W/DBpRO43OByXAi3VeAFMpniid3s8Daw35Jf ne7So6/bOaq6h8BLQE8cYDN4GtLN0RnDHQEYVTFgMXKnAkpYVx15s34rJ72JQPNsD43RFb I9olbRabbYlaBWq5EVflFkslRkNevA4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-427-zLsQ7xhKOae5M5-YPU7uIA-1; Wed, 26 Aug 2020 06:57:10 -0400 X-MC-Unique: zLsQ7xhKOae5M5-YPU7uIA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A4B64189E602; Wed, 26 Aug 2020 10:57:08 +0000 (UTC) Received: from krava (unknown [10.40.194.188]) by smtp.corp.redhat.com (Postfix) with SMTP id AE8271002D42; Wed, 26 Aug 2020 10:57:06 +0000 (UTC) Date: Wed, 26 Aug 2020 12:57:05 +0200 From: Jiri Olsa To: Kajol Jain Cc: acme@kernel.org, ak@linux.intel.com, yao.jin@linux.intel.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, irogers@google.com, maddy@linux.ibm.com, ravi.bangoria@linux.ibm.com Subject: Re: [RFC] perf/jevents: Add new structure to pass json fields. Message-ID: <20200826105705.GD703542@krava> References: <20200825074041.378520-1-kjain@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200825074041.378520-1-kjain@linux.ibm.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 25, 2020 at 01:10:41PM +0530, Kajol Jain wrote: SNIP > diff --git a/tools/perf/pmu-events/jevents.h b/tools/perf/pmu-events/jevents.h > index 2afc8304529e..e696edf70e9a 100644 > --- a/tools/perf/pmu-events/jevents.h > +++ b/tools/perf/pmu-events/jevents.h > @@ -2,14 +2,28 @@ > #ifndef JEVENTS_H > #define JEVENTS_H 1 > > +#include "pmu-events.h" > + > +struct json_event { > + char *name; > + char *event; > + char *desc; > + char *topic; > + char *long_desc; > + char *pmu; > + char *unit; > + char *perpkg; > + char *metric_expr; > + char *metric_name; > + char *metric_group; > + char *deprecated; > + char *metric_constraint; > +}; > + > int json_events(const char *fn, > - int (*func)(void *data, char *name, char *event, char *desc, > - char *long_desc, > - char *pmu, > - char *unit, char *perpkg, char *metric_expr, > - char *metric_name, char *metric_group, > - char *deprecated, char *metric_constraint), > - void *data); > + int (*func)(void *data, struct json_event *je), > + void *data); please also add typedef for the function, it's used in other places as well thanks, jirka