Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1432510lqa; Mon, 29 Apr 2024 08:18:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJ0abFzNdQCYiTmd6/7qBlMqetOOHhRJA9fSBpZkRLGhPcK+8nveG4MIREdtoGLVwan/wtpfTVEUu92pIYLDJgqxhnpVd2IwXgw9ZPmQ== X-Google-Smtp-Source: AGHT+IF0W0N/PeMfNyXK/d8pYPhskQw1Q32jxz9q4lZjFOL1Tlmo7jqhUt6ISdExf6wcCOKd8Xjs X-Received: by 2002:a05:6a00:4611:b0:6ec:d3a6:801 with SMTP id ko17-20020a056a00461100b006ecd3a60801mr14181723pfb.11.1714403928086; Mon, 29 Apr 2024 08:18:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714403928; cv=pass; d=google.com; s=arc-20160816; b=fw5Ad1V1btbktP4RFdnEkkqr9/vGjN9cRWwkN1t0Qlu5tTLJFoRyUl50Pw0X4f5Fql D5eDJiQ2d7CGjkk8Yng0yLY9JWUk70p9cUC8uxLxNBPlDoamSoaEvDspvbj0nvwaN0FH RJK0SCraBB+tAYLcBxeczoPcA3+kc9TeCmKfm2HgePTjPNHadGYBgWkTuYmjfvo6c6Us ovmKwU3aFHuAhMSjpCuYksAw9D5rs3LzBIIXQ1phspoThOWl7vWP1osHIJCqUUaZdEau I6SddbgQdMQMHJpR5V4g47q5SDRE64gVyrqipOsf+mWCzzr9k1QZvFj+6hU0eVHuSPHI 33Iw== 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 :date:subject:cc:to:from:dkim-signature; bh=A94d/W+ThzYnZ8KfKU0P6FPemrJH1TK2ILJNutp4pnc=; fh=F6LkFnc6uGFq+pVkM4uCbeFwlG50WrTihrpmsnpgMa8=; b=ZhLlYALECVm/NiAX/d8jgfCoswRZv7ptGagRHrsX7JYu4uayEnFpjBigl4FuebuZ3C gI/2sdwMmEXNjhFVXZX/109hqJOH+Xjj5eRqibn0FJZYtbUrwiZUVYzBPPJy6X1U8RYJ oacxT2Li6p4gLrBX3C/rIXXXDK7AgQbujCjlcsTtGpJaxpbVf+p53Muvrr1943ZR+cFN 0SZ8Wkvav2MeCnMQVUA5UkAkv8Rz8OPKtuLw2ZMHytnWInJ9GJmvlr5sL08Mfpzmdr7T RFzEL+MYOoyNaxKGa+O98hZadLy+EyNvGmoNb6NQoKBFa2l3SD7D6jD80WgsxmUKsb2L cVrA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jreTv6z5; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-162192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id j186-20020a638bc3000000b005f7fd3d5d4csi17684121pge.38.2024.04.29.08.18.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 08:18:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=jreTv6z5; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-162192-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162192-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 989DE285E7B for ; Mon, 29 Apr 2024 12:09:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id F0D2B5474B; Mon, 29 Apr 2024 12:09:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="jreTv6z5" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 8EF7D537E0 for ; Mon, 29 Apr 2024 12:09:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392562; cv=none; b=RIYYfjFXWpH18/WpGwpvwwIy/QkOdCRO7ngr7Oj1/st0t8ycrRjEDzr4iIr7itYe8CcT9AQ3e8eAZAe8QKhFMCf/NXTzuEgjTkLLwUgIiklMT8J14vsgMKJqEv/XXny/uUit9XVtTmLTnwE+icDbw/6q7ei1i3NmMJxwxUCqNXw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714392562; c=relaxed/simple; bh=ni7xzfycKKP1MKVU8EmsUqb3361Wz7LPiZp+v1kH+eQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zo6gRadhUwG1yJ4MLyVoCDWJeOx/sMwlPYuuZkEhRg90I7xOIQoS0DP4H7ZOw4/iwNj3FQrmYnYZXrxR0lsP3Nc8uUBGlvHU3C0sN0qEOmbw0Bw0PDWXcI1+A1W7eKx/1StAEesLLew7zStrqGVq3XwEFC6A3LRkMQcUWmTdXoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=jreTv6z5; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714392561; x=1745928561; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ni7xzfycKKP1MKVU8EmsUqb3361Wz7LPiZp+v1kH+eQ=; b=jreTv6z5Lqtst1K42qZvld9Fa+GCShFYJs7t3IXdihuQZDFqk7gRM3X3 izeARhTxnCyL4zhBbbki6qlI8/6zS3ww6Jvknm12ZOViygSYi/KsUeg2C BiXbKgv1B/R+tsqmT70IYR4aKI+FbKOS+lu57WHyw/zEUoPqkHylz+dSW BqUKdi1hH4OEFndeY0rUHoF476nRBWVStSavAHQWGRd4y4FvOIzud+D0Z UwEsqJSP/zFfFcMVKlNnGuD/lCNM4tTEu/0ZjMBwMy2k5B80/rVKkpjjM Q7xfyouwPaJlw1TNmvR6GsOa6gsabs52nxzZwLTZhwQTRwwUwikaDYIMQ A==; X-CSE-ConnectionGUID: f6oHwzDtTAC26JueOoaVsQ== X-CSE-MsgGUID: Tq31DkfqS7an3uRoxS4eiA== X-IronPort-AV: E=McAfee;i="6600,9927,11057"; a="9908216" X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="9908216" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Apr 2024 05:09:21 -0700 X-CSE-ConnectionGUID: 9kqqu18kRXa+a8BUdZFOEA== X-CSE-MsgGUID: ZvehNrR7T0+syPKBda//Fw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,239,1708416000"; d="scan'208";a="26166609" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmviesa010.fm.intel.com with ESMTP; 29 Apr 2024 05:09:18 -0700 From: Alexander Shishkin To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Mikhail Lappo , Alexander Shishkin , Andy Shevchenko Subject: [PATCH 02/14] stm class: Add source type Date: Mon, 29 Apr 2024 15:08:56 +0300 Message-ID: <20240429120908.3723458-3-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> References: <20240429120908.3723458-1-alexander.shishkin@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Mikhail Lappo Currently kernel HW tracing infrastrtucture and specifically its SyS-T part treats all source data in the same way. Treating and encoding different trace data sources differently might allow decoding software to make use of e.g. ftrace event ids by converting them to a SyS-T message catalog. The solution is to keep source type stored within stm_source_data structure to allow different handling by stm output/protocol. Currently we only differentiate between STM_USER and STM_FTRACE sources. Signed-off-by: Mikhail Lappo Signed-off-by: Alexander Shishkin Reviewed-by: Andy Shevchenko --- drivers/hwtracing/stm/console.c | 1 + drivers/hwtracing/stm/ftrace.c | 1 + drivers/hwtracing/stm/heartbeat.c | 1 + include/linux/stm.h | 12 ++++++++++++ 4 files changed, 15 insertions(+) diff --git a/drivers/hwtracing/stm/console.c b/drivers/hwtracing/stm/console.c index a00f65e21747..097a00ac43a7 100644 --- a/drivers/hwtracing/stm/console.c +++ b/drivers/hwtracing/stm/console.c @@ -22,6 +22,7 @@ static struct stm_console { .data = { .name = "console", .nr_chans = 1, + .type = STM_USER, .link = stm_console_link, .unlink = stm_console_unlink, }, diff --git a/drivers/hwtracing/stm/ftrace.c b/drivers/hwtracing/stm/ftrace.c index 3bb606dfa634..a7cea7ea0163 100644 --- a/drivers/hwtracing/stm/ftrace.c +++ b/drivers/hwtracing/stm/ftrace.c @@ -23,6 +23,7 @@ static struct stm_ftrace { .data = { .name = "ftrace", .nr_chans = STM_FTRACE_NR_CHANNELS, + .type = STM_FTRACE, .link = stm_ftrace_link, .unlink = stm_ftrace_unlink, }, diff --git a/drivers/hwtracing/stm/heartbeat.c b/drivers/hwtracing/stm/heartbeat.c index 81d7b21d31ec..e9496fe97baa 100644 --- a/drivers/hwtracing/stm/heartbeat.c +++ b/drivers/hwtracing/stm/heartbeat.c @@ -78,6 +78,7 @@ static int stm_heartbeat_init(void) } stm_heartbeat[i].data.nr_chans = 1; + stm_heartbeat[i].data.type = STM_USER; stm_heartbeat[i].data.link = stm_heartbeat_link; stm_heartbeat[i].data.unlink = stm_heartbeat_unlink; hrtimer_init(&stm_heartbeat[i].hrtimer, CLOCK_MONOTONIC, diff --git a/include/linux/stm.h b/include/linux/stm.h index 3b22689512be..2fcbef9608f6 100644 --- a/include/linux/stm.h +++ b/include/linux/stm.h @@ -30,6 +30,16 @@ enum stp_packet_flags { STP_PACKET_TIMESTAMPED = 0x2, }; +/** + * enum stm_source_type - STM source driver + * @STM_USER: any STM trace source + * @STM_FTRACE: ftrace STM source + */ +enum stm_source_type { + STM_USER, + STM_FTRACE, +}; + struct stp_policy; struct stm_device; @@ -106,6 +116,7 @@ struct stm_source_device; * @name: device name, will be used for policy lookup * @src: internal structure, only used by stm class code * @nr_chans: number of channels to allocate + * @type: type of STM source driver represented by stm_source_type * @link: called when this source gets linked to an STM device * @unlink: called when this source is about to get unlinked from its STM * @@ -117,6 +128,7 @@ struct stm_source_data { struct stm_source_device *src; unsigned int percpu; unsigned int nr_chans; + unsigned int type; int (*link)(struct stm_source_data *data); void (*unlink)(struct stm_source_data *data); }; -- 2.43.0