Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp238679rwb; Sun, 25 Sep 2022 19:39:19 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7a+opvL98KDvhvrZ1DaWzAmUG3ZXaG1KFvy1rie5PWqNvNuu2OT7sTZ9Lvwu4LvMOCIQuL X-Received: by 2002:a05:6402:1e8d:b0:454:79a9:201f with SMTP id f13-20020a0564021e8d00b0045479a9201fmr20482025edf.176.1664159959088; Sun, 25 Sep 2022 19:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664159959; cv=none; d=google.com; s=arc-20160816; b=0DFFcFR2nJWrhOsY2xWLWGVnt5AmuFblrvqFpfL1l7uJivTeJj1INxS9j8OS1z4EO5 UpXCzBT+8KcVYgHn+H97RE8kXG6PxcMT1QGJ3S4WuyLkqoEXHLIYtzyqcvDRYyjld/Zn QLEylNA/HWUITw+RrJjKNROYvwq84Ifiqdv7b9eyNtx6IomwhCsLGB3WIGCTLI96/jto B3wziqdpp0bLJxvTP+5mPhWlU2kd5Sklh07XnJOKsEpXUYWM6/pgEA17yps1MHQOokxx YBJ4u2PkcH1FPugQA9TaMuAnh953SG2OpYVIgr20oTtGK5xsznSaM5K7078BOzn+5R7E TiEA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version:date :subject:cc:from:message-id:dkim-signature; bh=cPukUtOLiqyi5AwR+ie+7DqHn1YGnUzhf4l9dRKS2kE=; b=NlV1QWS+rTwG3u1uxxvV22ZbpcoklPnqVhOr1EevxT+VQ6UUUWwICrikjGj9abuAqp Bpu3E/yVGvPYV8pIELBWOTw5/5hD9W96sNPlrcVTHqiIr+JMGq3NhZq6If9zWJbzhYzu fItrtz8JQ9ZZRWzMY681dOFtnKdR/GGlC7GpO1vLop0JFf7nhmfEkVGhXdrf+iqM0xRc yszuk/t2O+0nnegfXStiMhbK0b6OUEn1U66aYlLccQ8ZEgTEH+HCrYKzJiI6y7lrHcb4 FYS3M3m1aWsQPuO2GeHAlNHBnvKLzx7fAtW1kcos2HWFh+KMhHfkverEYp/R6aGvJm2f 9DVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@foxmail.com header.s=s201512 header.b=yU1Fmtl9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg11-20020a170907a40b00b0073d81e22d19si15877117ejc.544.2022.09.25.19.38.54; Sun, 25 Sep 2022 19:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@foxmail.com header.s=s201512 header.b=yU1Fmtl9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=foxmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233155AbiIZCYu (ORCPT + 99 others); Sun, 25 Sep 2022 22:24:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233214AbiIZCYl (ORCPT ); Sun, 25 Sep 2022 22:24:41 -0400 Received: from out162-62-57-210.mail.qq.com (out162-62-57-210.mail.qq.com [162.62.57.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43E4FA1A7; Sun, 25 Sep 2022 19:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foxmail.com; s=s201512; t=1664159074; bh=cPukUtOLiqyi5AwR+ie+7DqHn1YGnUzhf4l9dRKS2kE=; h=From:To:Cc:Subject:Date; b=yU1Fmtl9cy8zxZw0AQM9yCQexww+xzULjUUfn+pOMPZixDJvywhjhMxE//sxBgn/A +iukxXS9D9XHZDZyoKbsq1pMo48KJ4kPbBSePzgAoveHlhCXGoEG+OzG7lueCFw+tB hXSLHQpheLBMjUjm2rkYMxSeUzVqYMNjJ4udCLAs= Received: from localhost.localdomain ([39.156.73.13]) by newxmesmtplogicsvrsza30.qq.com (NewEsmtp) with SMTP id 5CEB689C; Mon, 26 Sep 2022 10:23:14 +0800 X-QQ-mid: xmsmtpt1664158994ta1rnlxni Message-ID: X-QQ-XMAILINFO: NQR8mRxMnur9LMOAlbYZPOsz9T9kLlmD8RWBpKDavG3lu2XpE9du0RZQxRbLzQ eqTv36OyRh5ryjjNe/9nMjXtlrSQP/bo7XvJMHIcDec7DqHHrvTxoyXZrOrglsmQlD8pV4sD0jMk ud9zmsD5xh6wDBp4D9Na/tgvwhhVnoJoeL4XHlOwpiDNaJpjtCfFhB/y4v45AwArutAMZzy/fN6s QRKhZvd25ci61PYBVgJtSD89JMtIsWofOQCxLngJiCd49R+sSIQtisaH401oOnIcHNqPsZHr3s1s 6ZlquRqsRYlBSeipYo0LY8k2P8eg+Q+IzzyD/S14dyR6CeJfqsYJug1Hyz95wfh5Gfay9lWVYj5/ /PXk5sdjGq9GFHmGvAzX5ejNzSU97iNfk15QGxvR0ySVBBUsRn2t/6PEcoE9kw00TD1x/Ue7IC37 kcgysU4d+EbMqeyOEShLrKvVFlby4Blv3KUTzfWcaWsoOooYk/4WsWoZXU2aSXNTU/ztbp8BzHGh hX+hwOvykowHpRoqxYliPKmamK1vrDvt/IpswTo3ltmWoRdgmV/NndVSxWy7AtsqWnTFJ39WbI8X Td20Zek/6hvic/NrsUVuV1lbcsvnReXtLian4uyCdgYzDXFbQ7sVSIeeujmuXBYU3Miu98iQBhY5 lz8YvAjY8SZn8YPlLVAWG6q04p2i3YbcsURoRgp5zHHteTTJooops5o7U4OX8+pyhbAz5pVBddfD Qiv8+LFJmb1tmCZv6HGqR2aiTsFU9Q+cOcidAfkWe+RNON1MbFl04uebq1Cy4TKgl5kJh0SbdjhQ d0fwFkTrBDPnJ9IsuiEP4/TLIljY+WXnh+k2BQD8aVnDuT3YZpki/qBV6OkAuAKA3zLtIWqYBGGp 10J9Umpx8qXBUmTnzjWIqAJBQygtv91ck+jQ93e8J7isQYR47911NSEvfz0BjJgHuwBmdqaaz4Dx b/UUXHyybVZu8gfwOg3dFsf/TQAH42dxb+0nZGwJN1szn0ts09tY0sliazYPnAOXJAim9bW2xOSk FAJlxY2jAsej7EJt5q From: Rong Tao Cc: Rong Tao , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH bpf-next] samples/bpf: offwaketime: pretty print Date: Mon, 26 Sep 2022 10:22:42 +0800 X-OQ-MSGID: <20220926022242.20222-1-rtoax@foxmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, HELO_DYNAMIC_IPADDR,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,RDNS_DYNAMIC, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rong Tao A sample of call stack: swapper/10 [ secondary_startup_64_no_verify cpu_startup_entry do_idle schedule_idle __schedule __traceiter_sched_switch __traceiter_sched_switch - try_to_wake_up call_timer_fn __run_timers.part.0 run_timer_softirq __softirqentry_text_start __irq_exit_rcu sysvec_apic_timer_interrupt asm_sysvec_apic_timer_interrupt cpuidle_enter_state cpuidle_enter cpuidle_idle_call do_idle cpu_startup_entry secondary_startup_64_no_verify ] swapper/10 1 Signed-off-by: Rong Tao --- samples/bpf/offwaketime_user.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/bpf/offwaketime_user.c b/samples/bpf/offwaketime_user.c index b6eedcb98fb9..d89278d62e4e 100644 --- a/samples/bpf/offwaketime_user.c +++ b/samples/bpf/offwaketime_user.c @@ -30,9 +30,9 @@ static void print_ksym(__u64 addr) } if (PRINT_RAW_ADDR) - printf("%s/%llx;", sym->name, addr); + printf("\t%s/%llx\n", sym->name, addr); else - printf("%s;", sym->name); + printf("\t%s\n", sym->name); } #define TASK_COMM_LEN 16 @@ -50,21 +50,21 @@ static void print_stack(struct key_t *key, __u64 count) static bool warned; int i; - printf("%s;", key->target); + printf("%s [\n", key->target); if (bpf_map_lookup_elem(map_fd[1], &key->tret, ip) != 0) { - printf("---;"); + printf("\t---\n"); } else { for (i = PERF_MAX_STACK_DEPTH - 1; i >= 0; i--) print_ksym(ip[i]); } - printf("-;"); + printf("\t-\n"); if (bpf_map_lookup_elem(map_fd[1], &key->wret, ip) != 0) { - printf("---;"); + printf("\t---\n"); } else { for (i = 0; i < PERF_MAX_STACK_DEPTH; i++) print_ksym(ip[i]); } - printf(";%s %lld\n", key->waker, count); + printf("] %s %lld\n", key->waker, count); if ((key->tret == -EEXIST || key->wret == -EEXIST) && !warned) { printf("stackmap collisions seen. Consider increasing size\n"); -- 2.31.1