From patchwork Thu Jun 6 10:39:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 801981 Delivered-To: patch@linaro.org Received: by 2002:adf:f147:0:b0:35b:5a80:51b4 with SMTP id y7csp226156wro; Thu, 6 Jun 2024 03:40:44 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWwwSYL/zKudQK+g8XBgEVkD1da8ZCkKc0WylNGrWxp2TDPHHUKc/bwFLyRqCPLKr4xe1TO3cKieCQDoEK//cCn X-Google-Smtp-Source: AGHT+IE9D2xwpazPyXxP9Mlk3eh8/MJQW0EPkKlBKn0uFoE1vizKBhwtK/8s8iIy25yTgPk4FFf/ X-Received: by 2002:a05:620a:729b:b0:790:b2a3:f86b with SMTP id af79cd13be357-79523d4d4b0mr553536385a.25.1717670444243; Thu, 06 Jun 2024 03:40:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717670444; cv=none; d=google.com; s=arc-20160816; b=JvSi3vcDgsmfcDXapuXpoZNF5+xe6tx196M88QTfZe/kofs8Htyh/K7Jj/vIJodBsV Y0QB76m1ue+8LztTtbBKhDK76zDugtxJRRgp+hGgrlqZYo01arBJGFE5GNWURX2w5e2Y eElNIEpWT2S3MwQ3k2nKnvLY7EuaQLPqoUI/XAalpG9fsN2rDd5X3VpogMMRF2Bhmq8I svPG1aGE+PTerMbAf7Jg3xTqXgfLXWhE/KLBJB/Zm5+Eb2L/xBYvpEasC3g9xjlkDJ5m 15rhtOemFa5LaY44C0GGI76EfOZaAfsGAfsuiGBqQmDK2N3vBQjPSMk/kFxtxtQYjm3b jBow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=t40djQlv053yA+vH29m5Xf5i4KWL84AS7zuIsTUNOcA=; fh=PzDM2D96kiCYo4l0PRMdYHJO7wAlAxW3siP0EoLGZRQ=; b=Nk2JfWKw/8K1Kp++lzOSF/Rfj2MU2ZpH1HWw8I2zuZApPcubce965LVGiiGBdq44+2 +OjmCNytndXnXXOkmZS9loPDAKbF2U/UgnhCRtmesas/dJQlNFJl5wGLtxRuXVchWL4G 7PG7hQX7dwST4RRKtnbzgb0ia7yL2iHq3TbJ4mV0DvmM2cSxg6QDuBAzrUXBepHMqc69 qwQ+CLiNBkYqmw1BU3chDrNNqrSfzvEd37zQ6DnAYdq1QrR+CN4erQQ4BE+UhDiZSG/p SVPfla72h1KXzbzfiyVwqq1qBFs75/C7t89W8J4csZInwOAMs0Knc6neSkl9VaZAlXJf n5sg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VJKoXadK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-795333a3e1asi117547885a.757.2024.06.06.03.40.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 06 Jun 2024 03:40:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VJKoXadK; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFAXH-0003md-NH; Thu, 06 Jun 2024 06:39:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFAXG-0003lz-8A for qemu-devel@nongnu.org; Thu, 06 Jun 2024 06:39:58 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sFAXD-0002kW-KS for qemu-devel@nongnu.org; Thu, 06 Jun 2024 06:39:58 -0400 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-421396e3918so11202985e9.0 for ; Thu, 06 Jun 2024 03:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717670393; x=1718275193; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=t40djQlv053yA+vH29m5Xf5i4KWL84AS7zuIsTUNOcA=; b=VJKoXadKSC4DyDfjah7F7O8+4JKSTt92vzSbjphQ3G6mbz8Ofl4hltGpfUojt1rWC5 pLRoeEStIyNMyIuU4VOUpr06peNHZihK0XovJPoRGBiG09hOA08doYODJWVzitQcDOjx kVamtWUHqZck9ahewFl5M//bYSDPMgunaK8Ygvm8S8T4EVbk2WEVy36/oV2H2ZWcVYJc kk7e7lq5ZdLyJMoOBSZZ408xSssKyrIhM7eZaFtWaUvKrZHCLl0V14bkCWwgPl+UwxZV 1NQpQy0p4qo2+lzUUug5MAfTpfNDOqwNW3t8gwz+CxXcYL0IblF7wjDX8gs65CMPZrVp WzSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717670393; x=1718275193; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=t40djQlv053yA+vH29m5Xf5i4KWL84AS7zuIsTUNOcA=; b=HQz0r20uk/5t+/90Mcgu0/r4mHxFFn10GhmkBHYxVTr83CoLfy48ny8FuBbUTueFgc 3UWYOZPadL0albk4zG/4bAlVTQiEexN2asvSBER+ovYM/Y71cKGrq135HCt1fq3WgQC7 L4q627s6Bkiqs7Tdjyt0aPf400iYX0lJkxoSTdJ7hA4+fjv6h0pmJGkosrcZjK7opKTH a43IEuEbYbg6DAlJ/XujZt6sbK3nWQxLdEVIZZuMrtbAo9myxdcr2r1aBUYG8jZ+JWYZ uuwD6pJbM16+X6LBjI44S9vQyN5twETezdSr6XSITu7N61yxmH2zyOv9SHXHbWfyzkMt B6Bg== X-Gm-Message-State: AOJu0YwHCVYTDpXVNG/zLJTDPhbVk0ThwtwrkBxpfCZC7mmjV1xHUBiN Y+INctx2lWBRR99epiQkFeG4aaNezquYY6NyTezsA0LiSJP9mNt4QraCsNApfpOY75HUWKWnU+t nKjk= X-Received: by 2002:a05:600c:a47:b0:41b:eaf2:f7e6 with SMTP id 5b1f17b1804b1-421562c3f28mr56338255e9.2.1717670393421; Thu, 06 Jun 2024 03:39:53 -0700 (PDT) Received: from localhost.localdomain (94.red-88-29-105.staticip.rima-tde.net. [88.29.105.94]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215c2cd8fcsm16877045e9.47.2024.06.06.03.39.51 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 06 Jun 2024 03:39:53 -0700 (PDT) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Alex Williamson , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , Mads Ynddal , Stefan Hajnoczi , Yoshinori Sato , Stefan Berger , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH 1/5] backends/tpm: Remove newline character in trace event Date: Thu, 6 Jun 2024 12:39:39 +0200 Message-ID: <20240606103943.79116-2-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20240606103943.79116-1-philmd@linaro.org> References: <20240606103943.79116-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Split the 'tpm_util_show_buffer' event in two to avoid using a newline character. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Daniel P. Berrangé Reviewed-by: Stefan Berger --- backends/tpm/tpm_util.c | 5 +++-- backends/tpm/trace-events | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/backends/tpm/tpm_util.c b/backends/tpm/tpm_util.c index 1856589c3b..cf138551df 100644 --- a/backends/tpm/tpm_util.c +++ b/backends/tpm/tpm_util.c @@ -339,10 +339,11 @@ void tpm_util_show_buffer(const unsigned char *buffer, size_t len, i; char *line_buffer, *p; - if (!trace_event_get_state_backends(TRACE_TPM_UTIL_SHOW_BUFFER)) { + if (!trace_event_get_state_backends(TRACE_TPM_UTIL_SHOW_BUFFER_CONTENT)) { return; } len = MIN(tpm_cmd_get_size(buffer), buffer_size); + trace_tpm_util_show_buffer_header(string, len); /* * allocate enough room for 3 chars per buffer entry plus a @@ -356,7 +357,7 @@ void tpm_util_show_buffer(const unsigned char *buffer, } p += sprintf(p, "%.2X ", buffer[i]); } - trace_tpm_util_show_buffer(string, len, line_buffer); + trace_tpm_util_show_buffer_content(line_buffer); g_free(line_buffer); } diff --git a/backends/tpm/trace-events b/backends/tpm/trace-events index 1ecef42a07..cb5cfa6510 100644 --- a/backends/tpm/trace-events +++ b/backends/tpm/trace-events @@ -10,7 +10,8 @@ tpm_util_get_buffer_size_len(uint32_t len, size_t expected) "tpm_resp->len = %u, tpm_util_get_buffer_size_hdr_len2(uint32_t len, size_t expected) "tpm2_resp->hdr.len = %u, expected = %zu" tpm_util_get_buffer_size_len2(uint32_t len, size_t expected) "tpm2_resp->len = %u, expected = %zu" tpm_util_get_buffer_size(size_t len) "buffersize of device: %zu" -tpm_util_show_buffer(const char *direction, size_t len, const char *buf) "direction: %s len: %zu\n%s" +tpm_util_show_buffer_header(const char *direction, size_t len) "direction: %s len: %zu" +tpm_util_show_buffer_content(const char *buf) "%s" # tpm_emulator.c tpm_emulator_set_locality(uint8_t locty) "setting locality to %d"