Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2109152pxb; Fri, 8 Oct 2021 00:36:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwAy2U4fy7wqJ/xbTiu87nOz1Ul1FTL4IppwSPSrjsdiwGf4hA2jnWtTCOcKr6xbbLc726u X-Received: by 2002:a50:e145:: with SMTP id i5mr12793517edl.16.1633678618322; Fri, 08 Oct 2021 00:36:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633678618; cv=none; d=google.com; s=arc-20160816; b=fVY0k0sdUKbjroQWHmDRNPIXt0s96zaGTGr8RWAWAvot9gqm9fv7d3VXxpzQdkre5J HGLhw4ER9oZZibm858YlMLqIl+I99WUHLxrbzVV+M0w1FYng9L9hUXtcRIxvoiN6kJn4 o5FvEoVhz/VA73AupfXiQxn6ipkR2DQiJthkIRz4+yc5e/goCIwAp1rS2jenq8bF/jwa 21IZrlIuKxc5wSuvaQbGAidz+uNxQuNyGobx0eANGkp6rS2vTS3g1Gxjs0X3DWfDR8I7 T+WAetGOh6lGh7V+ZczDAhntQMCV9xEVbWN5HkVPNiMeD4mpXmQSTZIjjraL5Ggsjzbj IzJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=O515ri/uV19LTvFhGL3lF3UGBzNdh3Gbb9rWE3lfUS8=; b=rawD5g5Nk0hj5DaV2pA4VlwnlPkdV1Z9IutN7vt95i8UqOv+AqS2TJlI0mSIN8DrBO JldTF2ElgKlNSVNvrxCuBdl+zG5+g44a8Bp++KjJRFqUve/0TULh9sWeSXEVCIrJuQwv HLK6wTCl2o3fvFfu1ee9xM3RCBtb5UabXT/eMERi/ZuFWnN56r4Bg8w8n2vK83VnqY2O fjB0N/1ME7ta0U7eKxmrXV8OdBfl6m+tqd199OKvqhnK2/xFyTSJCU9uiJkqSiV4bM66 3tkEKPPREyRM7ESZoqW3SQL5bwlXi7XqBF4Oc7nL7fxcEMegX6MCZ0NsCjvHsXzjlBkw QW7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=iZJYDZZu; 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 p5si2717039ejj.74.2021.10.08.00.36.33; Fri, 08 Oct 2021 00:36:58 -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=iZJYDZZu; 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 S231938AbhJHHf6 (ORCPT + 99 others); Fri, 8 Oct 2021 03:35:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31098 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229820AbhJHHf5 (ORCPT ); Fri, 8 Oct 2021 03:35:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633678441; 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=O515ri/uV19LTvFhGL3lF3UGBzNdh3Gbb9rWE3lfUS8=; b=iZJYDZZuD49woXTFR+3zpJkaoehW8IezzfiyLLN17s3NgJBPRMfLXpxZSbbvd1jVry/jit OTvb7ZUPXJA8X7a6CMAP8VcQn8CP5QI5LRru5SkkxpKcvlx1tDJSajPTqrtFGqFE+5YEq1 czYipy2HNF1c1QDaYM87EnRnUdLdeLs= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-545-4v3EZKSiPFOR3m3cuvSSrQ-1; Fri, 08 Oct 2021 03:34:00 -0400 X-MC-Unique: 4v3EZKSiPFOR3m3cuvSSrQ-1 Received: by mail-wr1-f71.google.com with SMTP id c4-20020a5d6cc4000000b00160edc8bb28so794769wrc.9 for ; Fri, 08 Oct 2021 00:34:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=O515ri/uV19LTvFhGL3lF3UGBzNdh3Gbb9rWE3lfUS8=; b=pnWfijAmNjATC0+Rli9mSucUEkpxyvaHnn46pf8NHZ69r3cA6vxqDUKdya0bJ2LIIZ Fhp9SB6l3b48WeTVlDhxv3XKGBur+DPlfX8bw0bIEW/OTTgW/zBdLsChqOe24zdcgVjO eKElxQov5AfzZgaHBt/KbrC5a8ZfUS4JokE3VDPWCJV5ybkFw5nV+m7lumbuph6U864u lqyPxiG/Gu7L+lAtXOVWrQFyuqOuAgu4oFm7TO8+LeKoU/eE7rM/vsD+by4K/IfwExyZ 9Nv/Dxfj/GE65r6dSknyh58JiOSddYwl3XrVA933g4gzD6EcdUi11M+NyQqCd8Q1V3j9 GOow== X-Gm-Message-State: AOAM53139LPhFX6jLo0Bc36c51oAW7hFGilOeJx9EjbqJCoBctkPymUG halaZjmlconDrZJ5ZpEh3BQx/f+923a65ib2PlfQ7f4bHphygN45J4NyVLkgov9KAK3kOni3knE 9MS2KudfnjlOojO9LPDCwCEUL X-Received: by 2002:adf:c048:: with SMTP id c8mr2048955wrf.96.1633678439765; Fri, 08 Oct 2021 00:33:59 -0700 (PDT) X-Received: by 2002:adf:c048:: with SMTP id c8mr2048932wrf.96.1633678439567; Fri, 08 Oct 2021 00:33:59 -0700 (PDT) Received: from krava (nat-pool-brq-u.redhat.com. [213.175.37.12]) by smtp.gmail.com with ESMTPSA id c9sm11021297wmb.41.2021.10.08.00.33.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Oct 2021 00:33:59 -0700 (PDT) Date: Fri, 8 Oct 2021 09:33:57 +0200 From: Jiri Olsa To: Alexey Bayduraev Cc: Arnaldo Carvalho de Melo , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Ingo Molnar , linux-kernel , Andi Kleen , Adrian Hunter , Alexander Antonov , Alexei Budankov , Riccardo Mancini Subject: Re: [PATCH v3 6/8] perf session: Move event read code to separate function Message-ID: References: <6ab47325fa261deca4ca55ecacf1ca2437abcd78.1633596227.git.alexey.v.bayduraev@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6ab47325fa261deca4ca55ecacf1ca2437abcd78.1633596227.git.alexey.v.bayduraev@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 07, 2021 at 01:25:41PM +0300, Alexey Bayduraev wrote: SNIP > static int > -reader__process_events(struct reader *rd, struct perf_session *session, > - struct ui_progress *prog) > +reader__read_event(struct reader *rd, struct perf_session *session, > + struct ui_progress *prog) > { > u64 size; > int err = 0; > union perf_event *event; > s64 skip; > > - err = reader__init(rd, &session->one_mmap); > - if (err) > - goto out; > - > -remap: > - err = reader__mmap(rd, session); > - if (err) > - goto out; > - > -more: > event = fetch_mmaped_event(rd->head, rd->mmap_size, rd->mmap_cur, > session->header.needs_swap); > if (IS_ERR(event)) > return PTR_ERR(event); > > if (!event) > - goto remap; > + return 1; > > session->active_decomp = &rd->decomp_data; > size = event->header.size; > @@ -2311,6 +2301,33 @@ reader__process_events(struct reader *rd, struct perf_session *session, > > ui_progress__update(prog, size); > > +out: > + session->active_decomp = &session->decomp_data; > + return err; > +} > + > +static int > +reader__process_events(struct reader *rd, struct perf_session *session, > + struct ui_progress *prog) > +{ > + int err; > + > + err = reader__init(rd, &session->one_mmap); > + if (err) > + goto out; > + > +remap: > + err = reader__mmap(rd, session); > + if (err) > + goto out; > + > +more: > + err = reader__read_event(rd, session, prog); > + if (err < 0) > + goto out; > + else if (err == 1) > + goto remap; > + > if (session_done()) > goto out; > > @@ -2318,7 +2335,6 @@ reader__process_events(struct reader *rd, struct perf_session *session, > goto more; > > out: > - session->active_decomp = &session->decomp_data; active_decomp should be set/unset within reader__process_events, not just for single event read, right? jirka > return err; > } > > -- > 2.19.0 >