From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753285AbdK1SRv (ORCPT ); Tue, 28 Nov 2017 13:17:51 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:46435 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751796AbdK1SRt (ORCPT ); Tue, 28 Nov 2017 13:17:49 -0500 X-Google-Smtp-Source: AGs4zMZZBXxW47LHysNG/INKIt8ZZDSTuCUgD5rJHKaPO8T1pT8XCyIvpDYIOjYJernuNpJBUmALzw== Message-ID: <1511893066.1754.8.camel@gmail.com> Subject: Re: [PATCH 04/11] trace-cmd: Extract parse_record_options() from trace_record() From: Vladislav Valtchev To: Steven Rostedt Cc: linux-kernel@vger.kernel.org, y.karadz@gmail.com Date: Tue, 28 Nov 2017 20:17:46 +0200 In-Reply-To: <20171128114822.0f80ed1e@gandalf.local.home> References: <20171123163335.19078-1-vladislav.valtchev@gmail.com> <20171123163335.19078-5-vladislav.valtchev@gmail.com> <20171128114822.0f80ed1e@gandalf.local.home> Organization: VMware Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.1-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2017-11-28 at 11:48 -0500, Steven Rostedt wrote: > > Is there a reason that init_instance() isn't called in > init_common_record_context()? > Hi Steven, init_instance() has been put into init_common_record_context() later, in patch 8, "Making start,extract,stream,profile separate funcs". > Also, why not just do the "init_common_record_context()" in > parse_record_options()? > Because they do semantically different things: trace_* function might want to do something before parsing the options, but after initilizing the context. That is what already happens in trace_profile(): during the refactoring I was able to remove a heading if (IS_PROFILE(ctx)) containing: handle_init = trace_init_profile; ctx.events = 1; and a tail: /* * If no instances were set, then enable profiling on the top instance. */ if (!buffer_instances) top_instance.profile = 1; Since that code was profile-specific, I put it in trace_profile(), without 'if' statements, clearly. Vlad