Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1776389ybk; Mon, 11 May 2020 04:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4YepDx7uPKTLMlMb8h0Rp1GMDROVIXTZ6gqA9IK+EAE1gVARcpS+JSfFEUR5zFUpkXJ6F X-Received: by 2002:aa7:dc49:: with SMTP id g9mr2156923edu.62.1589195175729; Mon, 11 May 2020 04:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589195175; cv=none; d=google.com; s=arc-20160816; b=Ce6dAkRpH9V6lw2mz/y2gjYdYlftKS4FiFHgwyjWQHoWBK7kwtwHgIZGnCpgDlKnXm P9ei1CP3iiLYKPKzz1xFFI8+x883jfcc9oTDEkTw1uEDSZUFTyY+cXCbiQ3jP1BM6G0J Edk7voV4NM7Zlhn+Reo2+uh9tNkIyJqo2ME6a1IbsjZ88YEq8/XwVoih6qucbFxf66Qd Wek8mKnOvw7vnOG80mDjCOiTD/rtRuwRFn8v7kHvrpOH/mQYWPLD47ewz8otlbktmFJi 9KIzpyjDZqAY84tR0wBM4DzilmzIEXy4BqxEmWbvJ2hPEDQRi6JGwlvzenyRvCTcpjLm FHzQ== 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=oFDVkhRoHqXvQ6Q+8XkWGBWxZCbZLeL6G8I1FDsAcKI=; b=PjgGa2H6Vj/RqhU6ZkUTXbEcPcFDvk6qhAwejo19dPBReoGK+YqUaUFPXwhFEP3TV5 gQTwnjBNINCpCLgr3Xyvi1m7ExoB56nGDZNQMiyIQSWBJ621rAPZdtVbm6wQtCWs3tXX QhMvC6OR8pi4bgwXpTptuSZC4rv6ewzLQCkTB1wJxWLP4IW1tBBQK8tmJEqbB2vjXCwB kTM9CEuZCK1yK+O5Q61RSQgl5a49wEpS5h6xI0Bob0XkdF3KZWliZ8BhwEBUVqzSPDjP OsFQhg23rsQpndxj7/ISwNLIon5CviHA/LqgV9ntuX4NdGip6OOXZiYmL9i7YiUrO1A2 TT8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=huMNMqYJ; 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 b25si284311edt.290.2020.05.11.04.05.51; Mon, 11 May 2020 04:06:15 -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=huMNMqYJ; 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 S1729605AbgEKLBt (ORCPT + 99 others); Mon, 11 May 2020 07:01:49 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:30630 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728136AbgEKLBs (ORCPT ); Mon, 11 May 2020 07:01:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589194907; 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=oFDVkhRoHqXvQ6Q+8XkWGBWxZCbZLeL6G8I1FDsAcKI=; b=huMNMqYJN46cyRV6jtJobDr/Lr0lDnESjvF8bZtAafJ62TX4naY7+jfQ0YHPbk46tFhnJm 6MCtJXDKIrr7t/hNO7/J//zKc0dGZiF2OlY3zAKKSrdtWoBlgrWA0xFHg46CZikU/rQBRQ CxMS6HjJV4EsWigJyAg0HshPra0VLpY= 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-449-N-YvmnBvNaWFqTnrZdz2WA-1; Mon, 11 May 2020 07:01:44 -0400 X-MC-Unique: N-YvmnBvNaWFqTnrZdz2WA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9EFD460; Mon, 11 May 2020 11:01:41 +0000 (UTC) Received: from krava (unknown [10.40.194.31]) by smtp.corp.redhat.com (Postfix) with SMTP id 4576D60FC2; Mon, 11 May 2020 11:01:38 +0000 (UTC) Date: Mon, 11 May 2020 13:01:37 +0200 From: Jiri Olsa To: John Garry Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, namhyung@kernel.org, will@kernel.org, ak@linux.intel.com, linuxarm@huawei.com, linux-kernel@vger.kernel.org, qiangqing.zhang@nxp.com, irogers@google.com, robin.murphy@arm.com, zhangshaokun@hisilicon.com, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH RFC v3 02/12] perf jevents: Add support for system events tables Message-ID: <20200511110137.GC2986380@krava> References: <1588852671-61996-1-git-send-email-john.garry@huawei.com> <1588852671-61996-3-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1588852671-61996-3-git-send-email-john.garry@huawei.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 07, 2020 at 07:57:41PM +0800, John Garry wrote: SNIP > + &sys_event_tables); > + } > + > print_events_table_prefix(eventsfp, tblname); > return 0; > } > @@ -1180,7 +1253,6 @@ int main(int argc, char *argv[]) > } else if (rc < 0) { > /* Make build fail */ > fclose(eventsfp); > - free_arch_std_events(); > ret = 1; > goto out_free_mapfile; > } else if (rc) { > @@ -1206,27 +1278,31 @@ int main(int argc, char *argv[]) > if (close_table) > print_events_table_suffix(eventsfp); > > - if (!mapfile) { > - pr_info("%s: No CPU->JSON mapping?\n", prog); > - goto empty_map; > + if (mapfile) { > + if (process_mapfile(eventsfp, mapfile)) { > + pr_err("%s: Error processing mapfile %s\n", prog, > + mapfile); > + /* Make build fail */ > + fclose(eventsfp); > + ret = 1; > + } > + } else { > + pr_err("%s: No CPU->JSON mapping?\n", prog); shouldn't we jump to empty_map in here? there still needs to be a mapfile, right? jirka > } > > - if (process_mapfile(eventsfp, mapfile)) { > - pr_info("%s: Error processing mapfile %s\n", prog, mapfile); > - /* Make build fail */ > + if (process_system_event_tables(eventsfp)) { > fclose(eventsfp); > - free_arch_std_events(); > ret = 1; > } > > - > goto out_free_mapfile; > > empty_map: > fclose(eventsfp); > create_empty_mapping(output_file); > - free_arch_std_events(); > out_free_mapfile: > + free_arch_std_events(); > + free_sys_event_tables(); > free(mapfile); > return ret; > } SNIP