From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 905CBC54E4B for ; Mon, 11 May 2020 11:01:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A87820801 for ; Mon, 11 May 2020 11:01:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SBJfdwv0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729600AbgEKLBk (ORCPT ); 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; > +} From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22DDAC54E4B for ; Mon, 11 May 2020 11:01:53 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DD96F20736 for ; Mon, 11 May 2020 11:01:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="m5q+n7H5"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SBJfdwv0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DD96F20736 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wr/HWiTbipvQO62lKx9X17l6WhVoPz52De8NQqQ2mdE=; b=m5q+n7H5TwunSl Dh3831TbSMeVy+G3jRSKZgGCz3hAnIzLJIM9KEDLQCgUl4sg48h4T0nlU/F+gUrIbxeXOJKPbZ2Rn nMkInznPMAxFbAvoAAqDaUmAHCWayq5vMpMwJYo/5+JYzHn984CrbFRXCWC+2pc3vvQVNIpRcdOri kdP+QGu14TY56135c+oTxFuxfoFeZCb5TAba3Qhxls0iASbHFTRGtizS3CUkrfXyg+Ku8SH4Y/e/U XEnbJK5U0hTF6H+3zwOLrvWfMLOG2wsnGaaTmrpTzKpVajB/yARaa8dHiayWF4L9dVma1J88tT2O+ DG4EOEYrExT2CHd/2ZJg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jY6Bx-0006Ui-2T; Mon, 11 May 2020 11:01:49 +0000 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120] helo=us-smtp-1.mimecast.com) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jY6Bo-0006Ns-Hr for linux-arm-kernel@lists.infradead.org; Mon, 11 May 2020 11:01:41 +0000 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 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-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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200511_040140_677700_4A704155 X-CRM114-Status: GOOD ( 10.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, irogers@google.com, ak@linux.intel.com, qiangqing.zhang@nxp.com, peterz@infradead.org, robin.murphy@arm.com, linuxarm@huawei.com, acme@kernel.org, linux-kernel@vger.kernel.org, zhangshaokun@hisilicon.com, alexander.shishkin@linux.intel.com, mingo@redhat.com, namhyung@kernel.org, will@kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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; > +} _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel