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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 26E1AC433EF for ; Fri, 8 Jul 2022 14:39:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238245AbiGHOj4 (ORCPT ); Fri, 8 Jul 2022 10:39:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238064AbiGHOj4 (ORCPT ); Fri, 8 Jul 2022 10:39:56 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F80813F0D; Fri, 8 Jul 2022 07:39:55 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 189966285E; Fri, 8 Jul 2022 14:39:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACFD4C341C6; Fri, 8 Jul 2022 14:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657291194; bh=n9Wx6YYU0Hw39VR6mkEgQaCtA6WpxtO3+AJlLEHoUFA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=ZSY/ZLBvJ/J3h/RRCHua4mwZbteQKzhRzR3P5WkJBs5pXv4cELtRWn62w3jwr+GWG wAx/XR6l//C3n6/+A6+LBVv/D9xLWKh0i+caBBV4fcwtvfS5BHiH5vmsvb/2gkfmFx JkS6E/KOOEfDVM3g6Vo1Zrh3hj6s39Xq3o3ymn4/DTe+EljcU/wngqdfSzPfTVjW+a DRHETPi08dBezjX/0b1j+5tULfEDgPQJP4IFOKiwdNNA6ulRLvYH8OQn75iIbKgiP+ oRM66EcHFeHqdJqEaD15nssvuRip1jVFp11Lblg6mKoRbN6K9Y/BoQLWcBGwuh54rj KrLu3esqMfCog== Message-ID: Date: Fri, 8 Jul 2022 16:39:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH V4 01/20] rv: Add Runtime Verification (RV) interface Content-Language: en-US To: Tao Zhou , Steven Rostedt Cc: Wim Van Sebroeck , Guenter Roeck , Jonathan Corbet , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Will Deacon , Catalin Marinas , Marco Elver , Dmitry Vyukov , "Paul E. McKenney" , Shuah Khan , Gabriele Paoloni , Juri Lelli , Clark Williams , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-trace-devel@vger.kernel.org References: <60548902dbccaa7ba420e40e46835693e27f643f.1655368610.git.bristot@kernel.org> From: Daniel Bristot de Oliveira In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org Hey Tao! On 7/6/22 19:49, Tao Zhou wrote: >> +static void *enabled_monitors_start(struct seq_file *m, loff_t *pos) >> +{ >> + struct rv_monitor_def *m_def; >> + loff_t l; >> + >> + mutex_lock(&rv_interface_lock); >> + m_def = list_entry(&rv_monitors_list, struct rv_monitor_def, list); > I realized this m_def is not real but vain. Is it possible the loop is > skiped and just return m_def that is not valid. that is empty... not a problem. I am not seeing (the possible) problem here. Could you simulate/reproduce the problem? Btw, this code is "inspired" (iow stolen) from trace_events.c. Am I missing something? steve? >> + for (l = 0; l <= *pos; ) { >> + m_def = enabled_monitors_next(m, m_def, &l); >> + if (!m_def) >> + break; >> + } >> + >> + return m_def; >> +} -- Daniel