From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 68991 invoked by alias); 19 Jul 2018 17:32:39 -0000 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org Received: (qmail 68965 invoked by uid 89); 19 Jul 2018 17:32:38 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: out1-smtp.messagingengine.com Received: from out1-smtp.messagingengine.com (HELO out1-smtp.messagingengine.com) (66.111.4.25) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Jul 2018 17:32:31 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 2D0B9219DA for ; Thu, 19 Jul 2018 13:32:30 -0400 (EDT) Received: from web3 ([10.202.2.213]) by compute3.internal (MEProxy); Thu, 19 Jul 2018 13:32:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=serhei.io; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=P5d6MReZuzwbueea3FtNFbOurOaVH VHb1CKcfraOmRs=; b=HvK2CXXvx9A3qzgONMXTfbvyLpRvoM6la8TtWnjTsFcii iwQtkywKQpeIRYpSoCG9VTk4G4qNv2i0BsFTb+JQqOh4sSQBpu82UaKcoC8bckw4 fuXje+k805pAaGKE57N8HUFx46Am6zG/ugNHW97v24G4GbKZCqRXDNurcI6Cv9dM qOWUiypwuBVJgHH+R1zIAuMHdkRENRali2syTxKREWSEn5KUKyJxAVTtVHT5An73 1rxI/LoXukiex2Eg1RQamXUmu2otGNy1sgEZXyCq8s2S0wY0d4BVvPZGlh1aC/zI NfOA11nme55s0HQJwg2RBvFU//J8nEPeUWzsAIjjw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=P5d6MR eZuzwbueea3FtNFbOurOaVHVHb1CKcfraOmRs=; b=d/Xv3UDe3YaMKoxO1DAmFp SYwxLeqpTvr8SOYjKQNHgqKNbaVaHZwlJ7L5XpNlMoCnvBU9ebLY7KBZYiJSBhgc 61kbBVI1wh1wghYzj4LdsvBbY0u70JQP0URv2/KgWFTuO/24TaFmIiYUq1x6fL24 oyExfq3fhJ21SbbtMXnaRoiAdXOuhIuQyYkKqR9Q2zJzmiQA0xefU7QdEG5omQDp Q+F3GRAodiR4WrvpxVYqxj7cSLW3tt4Yh0OeAxup//RUuQwAFb5J2auBiCNlaw/N WlrzOgc07/LgJLr874tKTkwcA5llpMZBvF6akEC8aKbjxwmnkuwhi3r4Ac3d2EKg == Received: by mailuser.nyi.internal (Postfix, from userid 99) id 630BE9E210; Thu, 19 Jul 2018 13:32:27 -0400 (EDT) Message-Id: <1532021547.3025234.1446386960.12364D48@webmail.messagingengine.com> From: Serhei Makarov To: systemtap@sourceware.org MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" References: <1531340017.1855006.1437712520.41D1C30F@webmail.messagingengine.com> <01c4f735-68b0-7d0b-11bf-0c89523839ca@redhat.com> In-Reply-To: <01c4f735-68b0-7d0b-11bf-0c89523839ca@redhat.com> Subject: Re: stap/eBPF language features brainstorm Date: Thu, 19 Jul 2018 17:32:00 -0000 X-IsSubscribed: yes X-SW-Source: 2018-q3/txt/msg00029.txt.bz2 On Thu, Jul 19, 2018, at 11:27 AM, William Cohen wrote: > probe timer.ms(5000) { > /* write out data */ > /* clear data */ > delete io_stat > delete device > read_bytes = 0 > write_bytes = 0 > } > > Is there some way to clear out all the previous entries in the bpf map > from the timer probe? > > -Will The only ways I can think of to 'clear out' a map from eBPF kernel space are fairly contrived. However, in the case of scripts like iotop.stp, there is no reason to run that 5-second timer in kernel-space. I don't see why it would require perf-like precision, so it could be handled by the userspace eBPF interpreter, where such operations are easier to support by iterating through the map elements. Last time we discussed this, Aaron mentioned some plans to implement support for userspace stapBPF timer probes. I'm not sure what the best option would be for specifying which timer probes should run in userspace and which ones should be handled in the kernel. Perhaps it could be decided automatically depending on whether userspace-only operations such as foreach or map_clear are detected in the probe body. All the best, Serhei