From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 5A9113851C0B for ; Tue, 17 Nov 2020 00:46:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5A9113851C0B Received: by mail-pf1-x435.google.com with SMTP id w14so15803519pfd.7 for ; Mon, 16 Nov 2020 16:46:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ajvM8IlRGm8xjr4R/et4dLfW+fn3i2kYUjd0GtQUrfY=; b=ofPE0iBX/Q71GBzgrKkgKy3ER+em5lMKaMYZtCq+ddBSMMx8PIZL8zMEmCwZn/36zZ JWWBzfcm8e0KERkgFp6YG/kIVnhrJEvFe9o5qtFUEtJ2l4I4kn/YFt6BA9okgDOW9NH+ TTSkH1FGfM0ZDAKrj6qxgRFNbj5OzEYEaqSL2PppoG4SAmNmp5iBaKVCGqJ/TyAqdK22 FdXaDHHsvviZmf+rgZpWdOd7Ia+UZsfSPoFkWP10eXlhebGPbuXXN2gBa1uG/FnRoynI naySuto/+KPjR+p9+QDJgifUPOGAynCWfGMDIGl0RVXzc6MIgRHU4eaYZ0UJ8ElXv8Qz 1vpw== X-Gm-Message-State: AOAM533vb/45/qPVABppwPLLwN5mw9XyAy1siVc0BxaZqw1x3YiPAcop bu3SPMrKF4u5qLGN3erdJpb+YX5rLko= X-Google-Smtp-Source: ABdhPJyrkESIGDTRvDzcaeHtXPYkhP0nTENrc4Dpz/hCGzp66KkKyPcpAtBsdgzVH/K+cOzP/Huqlg== X-Received: by 2002:a17:90a:c383:: with SMTP id h3mr1642196pjt.150.1605573982049; Mon, 16 Nov 2020 16:46:22 -0800 (PST) Received: from animal.lan (167-179-178-218.a7b3b2.bne.nbn.aussiebb.net. [167.179.178.218]) by smtp.gmail.com with ESMTPSA id z17sm19321850pfq.121.2020.11.16.16.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 16:46:21 -0800 (PST) From: Jamie Bainbridge To: systemtap@sourceware.org Subject: [PATCH] examples: add timestamp to dropwatch.stp Date: Tue, 17 Nov 2020 10:44:58 +1000 Message-Id: <1aa57ad4ab800448ce23d00096d58ab48955a65e.1605573722.git.jamie.bainbridge@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: systemtap@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Systemtap mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2020 00:46:24 -0000 When using dropwatch.stp to troubleshoot packet drops, it is often done with additional troubleshooting such as packet captures and collections of other commands like "ethtool -S" or "netstat -s". To correspond traffic loss events across the various output, these should all have timestamps. Add ctime timestamp to dropwatch to enable this. Update documentation to show example timestamp collection. Signed-off-by: Jamie Bainbridge --- .../en-US/Useful_Scripts-dropwatch.xml | 3 +++ testsuite/systemtap.examples/network/dropwatch.stp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-dropwatch.xml b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-dropwatch.xml index 73e4b0c347005758c2876449de4cd4c2acac38b2..f4afd00f9b466a9cf997f412b1d02bff75f0fa24 100644 --- a/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-dropwatch.xml +++ b/doc/SystemTap_Beginners_Guide/en-US/Useful_Scripts-dropwatch.xml @@ -85,14 +85,17 @@ each tracepoint location with either the function name or the address. <xref linkend="dropwatch"/> Sample Output Monitoring for dropped packets +Tue Nov 17 00:26:51 2020 1762 packets dropped at unix_stream_recvmsg 4 packets dropped at tun_do_read 2 packets dropped at nf_hook_slow +Tue Nov 17 00:26:56 2020 467 packets dropped at unix_stream_recvmsg 20 packets dropped at nf_hook_slow 6 packets dropped at tun_do_read +Tue Nov 17 00:27:01 2020 446 packets dropped at unix_stream_recvmsg 4 packets dropped at tun_do_read 4 packets dropped at nf_hook_slow diff --git a/testsuite/systemtap.examples/network/dropwatch.stp b/testsuite/systemtap.examples/network/dropwatch.stp index 99062009ac2104762e264083fcd9ed322cbe6b5e..90419d5410225bc0fd0f13bff27d888f07d2cf6e 100755 --- a/testsuite/systemtap.examples/network/dropwatch.stp +++ b/testsuite/systemtap.examples/network/dropwatch.stp @@ -20,7 +20,7 @@ probe kernel.trace("kfree_skb") { locations[$location] <<< 1 } # Every 5 seconds report our drop locations probe timer.sec(5) { - printf("\n") + printf("\n%s\n", ctime(gettimeofday_s())) foreach (l in locations-) { printf("%d packets dropped at %s\n", @count(locations[l]), symname(l)) -- 2.25.1