Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1774156ybk; Mon, 11 May 2020 04:03:44 -0700 (PDT) X-Google-Smtp-Source: APiQypKfYKs3XdNs6DwFGNDc9UsC1LOAJ792Uq4bPXI3WFiwb0xUnOierOGoIKWpc+8FmEZpLUCX X-Received: by 2002:aa7:d342:: with SMTP id m2mr12601385edr.130.1589195024683; Mon, 11 May 2020 04:03:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589195024; cv=none; d=google.com; s=arc-20160816; b=E6vHfVHZtT3bIdTTgKm/qtN+HfC9T6uEwlJjWvWpKfLrWIK8Qho6LfTh4PL7RJsuKI ZREU/HMGQDJo4il7mrKlOPp3owz6oLo9/RwpXpLbA3aWHl2NtH+8zZDQO3Hcj0znBDcn QETmkrSaDINYJ5gcbdrhB72UHwxFSuFjwOi6aawCzateSRMCMwxdNZHYq2cH13i8CNb3 dF5mzgQjjJmyUTof0HHBmZipknTSzcTjTOvQs6UsY2e3pHUxQiu9iT5avxDDR1yQwIAo cLqrbpdHvjhs6KHt6r2b5+pIXwawqd/60PRhGM18pk4h129vT6ignX0knU1XlBLrdU88 B2eA== 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=O4XZdKi10BPE8hXljNPQKlDFXXtBAToj+e/VOZfbERA=; b=LlgE7DGSRwprA3vd9u07Lk6a+t/yMdagPgMwY1PKYDgc7SSKUI+6WhQA8s6XUWciIm fQej/SYPHRyqF/OYq5FA2AhhPG07Tensus5EROfEU7ZvXAXwOPxnXc0szTNChYMUL3gN gwI8HyS+yF7EpgMJVNgTrrBeALODkGaXJtCZVaJVGCDoiMnwzJ3YUnhphTdv4vArTF2K X7BrEdAwjjOTm6lkk0kxHEu0ZDtqZIQY0ZHLSfUUFAsmRWSHlsr2SaIney8aEqBrVdh3 gnvfrVO7O+LLkanJp3vB0DBWUgAd8Qljz8diLHHrjU8Ltahxo3vYj2rW6d5R49EH2QJU UaYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SBJfdwv0; 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 r22si6094440edy.486.2020.05.11.04.03.22; Mon, 11 May 2020 04:03:44 -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=SBJfdwv0; 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 S1729595AbgEKLBk (ORCPT + 99 others); Mon, 11 May 2020 07:01:40 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:57835 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728209AbgEKLBk (ORCPT ); Mon, 11 May 2020 07:01:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589194899; 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=O4XZdKi10BPE8hXljNPQKlDFXXtBAToj+e/VOZfbERA=; b=SBJfdwv0JBMPBTxL2NwB/06BSO0N9+B/beRsrsqYchElPorzvJrBVmGy55dH203shoUvEJ d8CYhDow/2IBl5c/l5sGW252wahQQdAGwgqPHD/ZYi0d1m0td6wpuXpWSdgJtwOeyX/fOa S0krBDUfdh6XNmii/2/dUskR5BJEZnM= 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-305-93o9sHwmN4CiUFwVvLFFxg-1; Mon, 11 May 2020 07:01:35 -0400 X-MC-Unique: 93o9sHwmN4CiUFwVvLFFxg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BA1058014C0; Mon, 11 May 2020 11:01:32 +0000 (UTC) Received: from krava (unknown [10.40.194.31]) by smtp.corp.redhat.com (Postfix) with SMTP id ADF939CB9; Mon, 11 May 2020 11:01:28 +0000 (UTC) Date: Mon, 11 May 2020 13:01:27 +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: <20200511110127.GB2986380@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.11 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 > > +static bool is_sys_dir(char *fname) > +{ > + char *pos; > + > + while (true) { > + pos = strchr(fname, '/'); would strrchr be faster? also I thought there's something like basename function that could be usable in here? jirka > + > + if (!pos) { > + if (!strcmp(fname, "sys")) > + return true; > + return false; > + } > + > + fname = pos + 1; > + } > + > + return false; > +}