Received: by 10.223.176.5 with SMTP id f5csp2035507wra; Thu, 8 Feb 2018 07:27:32 -0800 (PST) X-Google-Smtp-Source: AH8x224EM+So0+t9JQJHeimwji9mySy1zEr8EcVDRzpeb8IN8Vvf00ymGqCMuZhMTEVhahKCxzv2 X-Received: by 2002:a17:902:20e3:: with SMTP id v32-v6mr968934plg.405.1518103652663; Thu, 08 Feb 2018 07:27:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518103652; cv=none; d=google.com; s=arc-20160816; b=oIAvU6lhJAeU6UZ3LHrHyaFLXhEt6iSh6ttRmphDrWLDZQRYSG3pTXj+WnvKT6QCs+ lLRYIStnQyHOWN9DyrmUq9cgPsx9v/C/tyxMTSWBoUPbA59wpun25GKNDi2FndN71Gyv WWynp4R4A23yqqt2NXqXM8/r5aNeQqvodvA8PcGPHUzWIpkEjQv47Gg+Ym2VKvOZWkYL lLZUKRVys5Hl44p191UBd9pgVgXHopSIzvUtuzV64jgefoJIxM5DBXR/lT+ml7QF1r0W a2Rkhc6j0uHjo6Y8FiRUY5TosDUf8dXyFvz/HFeRBVpHy0zmhx3hOWOPt7b0lhLr+9v1 Xd3w== 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:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=FvVqfZt2lT++hAyAUvoUQovBGVsuhqfFeJIx7blvAj8=; b=BkYfff79TC675tgcKbQ0RTOlJC40HxmImh5M4zh4x1/VdzAbgVN3nnm9NED2NFa25U UY+Ehq2uJK2zXt7eP3TyL4rsgwLAJd1qyJxD9SgpAl954sk7qgenm9F6yzbXHHyIwZ0/ q3MqHI6xPouG62A2njXhAPF1HKBh2YEwtaLNScvKUbshesToiFgm/VKjkPSqt81q6xqL YJK8laPVHtSeQd2lZmzGk/BJ7Yzbh7TJzZ4viQjl0S2NIaI8RH842kEbfTU7asrhIA0j TPAk9ra3kA0COQcL5SAa/VB8tAz6in/wyymiV4fVNj45jSQA1HYX/leHf462/Gq6ez09 Sc3Q== 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 f15-v6si103477plk.245.2018.02.08.07.27.16; Thu, 08 Feb 2018 07:27:32 -0800 (PST) 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 S1751946AbeBHP0E (ORCPT + 99 others); Thu, 8 Feb 2018 10:26:04 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:5188 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751310AbeBHP0D (ORCPT ); Thu, 8 Feb 2018 10:26:03 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6DCA587D58465; Thu, 8 Feb 2018 23:25:46 +0800 (CST) Received: from [127.0.0.1] (10.202.227.238) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Thu, 8 Feb 2018 23:25:37 +0800 Subject: Re: [PATCH 5/9] perf utils: add support for arch standard events To: Jiri Olsa References: <1517939104-230881-1-git-send-email-john.garry@huawei.com> <1517939104-230881-6-git-send-email-john.garry@huawei.com> <20180208135533.GI10234@krava> CC: , , , , , , , , , , , , From: John Garry Message-ID: <312796a3-9818-7793-9e28-7a686c990977@huawei.com> Date: Thu, 8 Feb 2018 15:25:30 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <20180208135533.GI10234@krava> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.202.227.238] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/02/2018 13:55, Jiri Olsa wrote: > On Wed, Feb 07, 2018 at 01:45:00AM +0800, John Garry wrote: > > SNIP > >> >> +static int is_json_file(const char *name) >> +{ >> + const char *suffix; >> + >> + if (strlen(name) < 5) >> + return 0; >> + >> + suffix = name + strlen(name) - 5; >> + >> + if (strncmp(suffix, ".json", 5) == 0) >> + return 1; >> + return 0; >> +} >> + >> +static int preprocess_arch_std_files(const char *fpath, const struct stat *sb, >> + int typeflag, struct FTW *ftwbuf) >> +{ >> + int level = ftwbuf->level; >> + int is_file = typeflag == FTW_F; >> + >> + if (level == 1 && is_file && is_json_file(fpath)) >> + return json_events(fpath, save_arch_std_events, (void *)sb); > > so any .json file will pass.. Yes, so according to the scheme any architecture JSONs should be placed in the arch root folder. just wondering you'd want to put > some name restriction for recomended events file like this -recomended > suffix you used later.. but that can be added later in case we'll > need some other json files in here ;-) Sorry, but I don't see what the naming restriction would mean in practice. Thanks, John > > jirka > > . >