Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp13751rdb; Wed, 21 Feb 2024 15:15:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUaV8a2cMjHkzEGif7Q5AnbyorUrD4aSF+e1mu86zYa/g3p6G2V69GPGb6up5o4uFJgLe/9WuH70wSRNjNGmM0CWsv1C2VqS/dqzz4Kgg== X-Google-Smtp-Source: AGHT+IFfnv4zksVCDue9MxiSe0fwt+mSGyPD9qvRore1YL1Q7o/vTlWjKAFCQ3K3Qb/klrRZzxC3 X-Received: by 2002:a17:906:b259:b0:a3e:56d5:71fd with SMTP id ce25-20020a170906b25900b00a3e56d571fdmr7756710ejb.47.1708557337748; Wed, 21 Feb 2024 15:15:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708557337; cv=pass; d=google.com; s=arc-20160816; b=Hwf6ZlVfuQ3z0JiqrDdfm4ENVppWYgyTW2VkFYI+acsJ4hmS4xt8kBjiJLgOJpGrNW A7rsLp48+r2gSA5k0YVzYJNpxSZ2wNlX5xZb7hhc4d3yebIVb4EJy4+uBNB8g6ZzNR35 At77t79k6dYFcAUlDBlKvawoHw9QSof26MDYA1vs/Uodww/YSPO98Z3NcsYwA1SWc5RS 5hmHCwkSDNA9D1RAP8xa6Lj6S0lEOZHcpTKZyWPp2QJr80dM7EMYw7dcolRvn6Rw+P+b WSFwQnD5YEPtoVqv+m+s6z4nCO+Zzi+Dwx3qHlw01Ed6QZHZBUzQgzdXvujVl3HTlgRI N/gA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date; bh=4ffAFV9Axn0j99jphXZU6Q4BE56rtBQFiXrAwR89jEQ=; fh=yO5Volq54THp7D77J17YkC4h+zMi2VETNr7cfhpsRJ8=; b=P3Qq4WvQmmZyS/a/v7lScE7GtBiKDd7jpc+izzESiVTDhT12YxTRlJVyvssJfyxrmu 4wW+qyN4Zd9/93Wo0JhbEoLQsj5HbMDxEuw1AaDyPzsEdeGZjJ19fObmWUh9w0kD69TO nkLcPP7w9GoJ8NESoQgAj6SdN91Rcyrc1uDLnCEXyjzhOIFftXtMFXtvfx3LGNzfMfx0 xthfevMHQX63OhhiSn23pxSBV1JoOT5u8aumdoXgWn7luHDyd89tqIwTwf5yt09UGkN5 0AsTJDT+nspvemfI2qKeoyTgoeH2qqN0a0z291U+UDHtjZYjWU7pqUsUJnl01cl7Pr6U V6gg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-75638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75638-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g2-20020a170906c18200b00a3ec8a31c0csi2710827ejz.974.2024.02.21.15.15.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 15:15:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-75638-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75638-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 56E781F23719 for ; Wed, 21 Feb 2024 23:15:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D24212837E; Wed, 21 Feb 2024 23:15:28 +0000 (UTC) Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C47F985268 for ; Wed, 21 Feb 2024 23:15:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708557327; cv=none; b=ShtyZAwLGJZpsLeLOp+n5GzhzmMXpoVrzvxRa3S4NBbfyapBk/FsoURfRB3SRO6fPaO4EdHgae8jVQt7eyqOhUz0YuCz8uNVnzNxbS0o7KBKI5YO6ViGyezyAWyLEeBVul0LLzfSpfOtjr2t7V5odLJB3DcWkvAaanl1wCK7GGA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708557327; c=relaxed/simple; bh=PASu4t2rYovLjssJl3r/y3MJM44QJFipAJ0uuNsaxOU=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eLYYt+SSQggqx2tzzdpZwtwGfDQKodgIyrzRIhosbzbO+aYP3afwoGmLlu8khr7C3/IEFx5XR78u1SIDXNA5qwKbNkd6ZUnFw11vRVZbPiKJ73KLqUFJQGgTHEZ4iW2E7lS5ivEU6xC2xXiaJklbf1R74n29r0geX5QK8jeZDwA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5BD4DC433F1; Wed, 21 Feb 2024 23:15:25 +0000 (UTC) Date: Wed, 21 Feb 2024 18:17:13 -0500 From: Steven Rostedt To: Anna-Maria Behnsen Cc: linux-kernel@vger.kernel.org, Peter Zijlstra , John Stultz , Thomas Gleixner , Eric Dumazet , "Rafael J . Wysocki" , Arjan van de Ven , "Paul E . McKenney" , Frederic Weisbecker , Rik van Riel , Sebastian Siewior , Giovanni Gherdovich , Lukasz Luba , "Gautham R . Shenoy" , Srinivas Pandruvada , K Prateek Nayak , Christian Loehle Subject: Re: [PATCH v11 19/20] timer_migration: Add tracepoints Message-ID: <20240221181713.12f530cb@gandalf.local.home> In-Reply-To: <20240221090548.36600-20-anna-maria@linutronix.de> References: <20240221090548.36600-1-anna-maria@linutronix.de> <20240221090548.36600-20-anna-maria@linutronix.de> X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 21 Feb 2024 10:05:47 +0100 Anna-Maria Behnsen wrote: > diff --git a/include/trace/events/timer_migration.h b/include/trace/events/timer_migration.h > new file mode 100644 > index 000000000000..3f6e9502c41e > --- /dev/null > +++ b/include/trace/events/timer_migration.h > @@ -0,0 +1,297 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > + > +DECLARE_EVENT_CLASS(tmigr_group_and_cpu, > + > + TP_PROTO(struct tmigr_group *group, union tmigr_state state, u32 childmask), > + > + TP_ARGS(group, state, childmask), > + > + TP_STRUCT__entry( > + __field( void *, group ) > + __field( void *, parent ) > + __field( unsigned int, lvl ) > + __field( unsigned int, numa_node ) > + __field( u8, active ) > + __field( u8, migrator ) > + __field( u32, childmask ) Could you move the two u8 after the u32? Although it probably doesn't matter for the actual size, I prefer to keep holes from inside the structure. The above will create a two byte hole between the two u8 and the u32. > + ), > + > + TP_fast_assign( > + __entry->group = group; > + __entry->parent = group->parent; > + __entry->lvl = group->level; > + __entry->numa_node = group->numa_node; > + __entry->active = state.active; > + __entry->migrator = state.migrator; > + __entry->childmask = childmask; > + ), > + > + TP_printk("group=%p lvl=%d numa=%d active=%0x migrator=%0x " > + "parent=%p childmask=%0x", > + __entry->group, __entry->lvl, __entry->numa_node, > + __entry->active, __entry->migrator, > + __entry->parent, __entry->childmask) > +); > + > +DEFINE_EVENT(tmigr_group_and_cpu, tmigr_group_set_cpu_inactive, > + > + TP_PROTO(struct tmigr_group *group, union tmigr_state state, u32 childmask), > + > + TP_ARGS(group, state, childmask) > +); > + > +DEFINE_EVENT(tmigr_group_and_cpu, tmigr_group_set_cpu_active, > + > + TP_PROTO(struct tmigr_group *group, union tmigr_state state, u32 childmask), > + > + TP_ARGS(group, state, childmask) > +); > + > +/* CPU events*/ > +DECLARE_EVENT_CLASS(tmigr_cpugroup, > + > + TP_PROTO(struct tmigr_cpu *tmc), > + > + TP_ARGS(tmc), > + > + TP_STRUCT__entry( > + __field( void *, parent) > + __field( unsigned int, cpu) > + __field( u64, wakeup) Please put the u64 first. That way on 32 bit machines, parent and cpu will fit together and on 64 bit machines, there will not be a hole between cpu and wakeup. > + ), > + > + TP_fast_assign( > + __entry->cpu = tmc->cpuevt.cpu; > + __entry->parent = tmc->tmgroup; > + __entry->wakeup = tmc->wakeup; > + ), > + > + TP_printk("cpu=%d parent=%p wakeup=%llu", __entry->cpu, __entry->parent, __entry->wakeup) > +); > + > +DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_new_timer, > + > + TP_PROTO(struct tmigr_cpu *tmc), > + > + TP_ARGS(tmc) > +); > + > +DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_active, > + > + TP_PROTO(struct tmigr_cpu *tmc), > + > + TP_ARGS(tmc) > +); > + > +DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_online, > + > + TP_PROTO(struct tmigr_cpu *tmc), > + > + TP_ARGS(tmc) > +); > + > +DEFINE_EVENT(tmigr_cpugroup, tmigr_cpu_offline, > + > + TP_PROTO(struct tmigr_cpu *tmc), > + > + TP_ARGS(tmc) > +); > + > +DEFINE_EVENT(tmigr_cpugroup, tmigr_handle_remote_cpu, > + > + TP_PROTO(struct tmigr_cpu *tmc), > + > + TP_ARGS(tmc) > +); > + > +DECLARE_EVENT_CLASS(tmigr_idle, > + > + TP_PROTO(struct tmigr_cpu *tmc, u64 nextevt), > + > + TP_ARGS(tmc, nextevt), > + > + TP_STRUCT__entry( > + __field( void *, parent) > + __field( unsigned int, cpu) > + __field( u64, nextevt) > + __field( u64, wakeup) Please put parent and cpu after wakeup so that there will not be a hole around cpu. > + ), > + > + TP_fast_assign( > + __entry->cpu = tmc->cpuevt.cpu; > + __entry->parent = tmc->tmgroup; > + __entry->nextevt = nextevt; > + __entry->wakeup = tmc->wakeup; > + ), > + > + TP_printk("cpu=%d parent=%p nextevt=%llu wakeup=%llu", > + __entry->cpu, __entry->parent, __entry->nextevt, __entry->wakeup) > +); > + > +DEFINE_EVENT(tmigr_idle, tmigr_cpu_idle, > + > + TP_PROTO(struct tmigr_cpu *tmc, u64 nextevt), > + > + TP_ARGS(tmc, nextevt) > +); > + > +DEFINE_EVENT(tmigr_idle, tmigr_cpu_new_timer_idle, > + > + TP_PROTO(struct tmigr_cpu *tmc, u64 nextevt), > + > + TP_ARGS(tmc, nextevt) > +); > + > +TRACE_EVENT(tmigr_update_events, > + > + TP_PROTO(struct tmigr_group *child, struct tmigr_group *group, > + union tmigr_state childstate, union tmigr_state groupstate, > + u64 nextevt), > + > + TP_ARGS(child, group, childstate, groupstate, nextevt), > + > + TP_STRUCT__entry( > + __field( void *, child ) > + __field( void *, group ) > + __field( u64, nextevt ) > + __field( u64, group_next_expiry ) > + __field( unsigned int, group_lvl ) > + __field( u8, child_active ) > + __field( u8, group_active ) > + __field( unsigned int, child_evtcpu ) > + __field( u64, child_evt_expiry ) Please put child_evt_expiry after group_next_expiry. Have group_lvl next to child_evtcpu and the two u8 fields at the end. Thanks! -- Steve > + ), > + > + TP_fast_assign( > + __entry->child = child; > + __entry->group = group; > + __entry->nextevt = nextevt; > + __entry->group_next_expiry = group->next_expiry; > + __entry->group_lvl = group->level; > + __entry->child_active = childstate.active; > + __entry->group_active = groupstate.active; > + __entry->child_evtcpu = child ? child->groupevt.cpu : 0; > + __entry->child_evt_expiry = child ? child->groupevt.nextevt.expires : 0; > + ), > + > + TP_printk("child=%p group=%p group_lvl=%d child_active=%0x group_active=%0x " > + "nextevt=%llu next_expiry=%llu child_evt_expiry=%llu child_evtcpu=%d", > + __entry->child, __entry->group, __entry->group_lvl, __entry->child_active, > + __entry->group_active, > + __entry->nextevt, __entry->group_next_expiry, __entry->child_evt_expiry, > + __entry->child_evtcpu) > +); > + > +TRACE_EVENT(tmigr_handle_remote, > + > + TP_PROTO(struct tmigr_group *group), > + > + TP_ARGS(group), > + > + TP_STRUCT__entry( > + __field( void * , group ) > + __field( unsigned int , lvl ) > + ), > + > + TP_fast_assign( > + __entry->group = group; > + __entry->lvl = group->level; > + ), > + > + TP_printk("group=%p lvl=%d", > + __entry->group, __entry->lvl) > +); > +