From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: MPS: profiler Date: Fri, 21 Jun 2024 09:43:07 +0200 Message-ID: References: <87v823xvq1.fsf@localhost> <86cyobmmhc.fsf@gnu.org> <87r0crxung.fsf@localhost> <87le2zxsqx.fsf@localhost> <8634p6n7jd.fsf@gnu.org> <87tthm3gq2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11790"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , Ihor Radchenko , emacs-devel@gnu.org To: Helmut Eller Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 21 09:43:38 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sKYvq-0002qR-0R for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Jun 2024 09:43:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKYvR-0002iw-Oz; Fri, 21 Jun 2024 03:43:13 -0400 Original-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 1sKYvQ-0002if-NJ for emacs-devel@gnu.org; Fri, 21 Jun 2024 03:43:12 -0400 Original-Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKYvP-0003tt-8O; Fri, 21 Jun 2024 03:43:12 -0400 Original-Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-57d15b85a34so1921656a12.3; Fri, 21 Jun 2024 00:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718955789; x=1719560589; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qMsZY4pbWRiaIA9Dlk1rPBYKhgONHKjhdKxW6pfJaPE=; b=fvCDq/3T8hanix812UhZfS1gBRKvoG64YHSjCrkPllSLqGEpaN/VTv+MhRpTODnsIo t0Dur2cAJUmScGpRWp0Q/Sacth+iqZtfUSPpRdIZDGnKs8sZJsHGl8U4o48GMoSI+z4k XFdwtI9Y40sZQx4+W0obZtHIyQ9+M2R/yd71mP64C3dMWS9Kdh3k1xMaPO906d0aDJ0z nFwluF0J5RhnoYRqtwGTSKZStUN50nOPPVtD1X4tVW2xhL01yhPuCcrXJxBQYm3XNJol aypIhLVEHosXKHqsCCveCoX14ae4wVrdRDiRmjNZR7Nyc1Hu2M1Jjwu8zqGxXON84O1n ebCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718955789; x=1719560589; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qMsZY4pbWRiaIA9Dlk1rPBYKhgONHKjhdKxW6pfJaPE=; b=EiIIGtZRbqxCrM5J2QpeYO4G8H5sl0cnK9Nfz7cuAjiecd6yxBeR8E/xkz9cVNQxWq 1UQhyBu17JGWnc4ilFEJa+Do8LLHYFGeWg25AWdvzUKLi64cW+pAr+zFTLD+d1og2dzD BwQnv4PsaUQoRT9sbNvMsAh83HFTfJKO0RFzmUuzOxOaNWq0MHJAaS7Ny4LubZop1YPn 9HePrVXEYiDNHIBIUafUKPI0iOnSWj7JgGN1gSgFOJjINCF8PKDZgjPxdZZnor90cKLo qSY/I4Cisy1ZHg6KAmf4CPfVE11iLxU23HdXKm0XZz7HSxIdxwRw3JpUE6LUNOk6wyhU kc8A== X-Forwarded-Encrypted: i=1; AJvYcCVzmqK8e2Ks0ZhQwLrRSfPOIl/n6bWPKYH8bJUZZ/tJb8GNjCdAjc8ZNmWVxX5pZcmvbC/+yrfpfPIlO4BHfublO/FH X-Gm-Message-State: AOJu0YyQd7/diQlvDPfnErZqQUK9R/2Q3wwN6wVif3eoMrq6nQDXhgNF zmqXI81NR5scbsj8/diTKiPGo4B/fdu+PHwxF7LdhBlq8wxRtWg8XJMEew== X-Google-Smtp-Source: AGHT+IHvP0nwDBmjONg5RpAwxSCaCJh+ZjY7Z9pGYUDP/TcwMl+WKa1QZeRZUmDEtVTghLpXceu8hA== X-Received: by 2002:a17:906:682:b0:a6f:86fd:72b8 with SMTP id a640c23a62f3a-a6fab648c90mr485675366b.42.1718955788415; Fri, 21 Jun 2024 00:43:08 -0700 (PDT) Original-Received: from pro2.fritz.box (p4fe3a72a.dip0.t-ipconnect.de. [79.227.167.42]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6fd640fac1sm7989966b.213.2024.06.21.00.43.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 00:43:08 -0700 (PDT) In-Reply-To: <87tthm3gq2.fsf@gmail.com> (Helmut Eller's message of "Fri, 21 Jun 2024 09:19:49 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::533; envelope-from=gerd.moellmann@gmail.com; helo=mail-ed1-x533.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, FREEMAIL_FROM=0.001, 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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:320368 Archived-At: Helmut Eller writes: > On Fri, Jun 21 2024, Gerd M=C3=B6llmann wrote: > >> Eli Zaretskii writes: >> >>> Also, can 'static struct profiler_log cpu', which is being worked on >>> by record_backtrace, be affected by MPS in any way? >> >> I'd guess that just "touching" Lisp objects in the SIGPROF handler can >> be problematic because these objects themselves can be behind a barrier, >> either the same that MPS is currently working on when it got interrupted >> or another one. > > Perhaps dflt_scan should block SIGPROF while it is running. Or perhaps > dflt_scan should set some global flag while it running so that the > profiler knows that it's too dangerous to touch anything.=20=20 I kind of doubt that's sufficient because there are time windows in MPS itself where dflt_scan is not running, and it maybe doing dangerous things. There is no guarantee I'd say. > Any better ideas? > > I can use this command to reproduce the problem: > > run -Q -batch -eval '(progn > (defvar *baz* nil) > (defun bar (len) > (let ((data (make-list len nil))) > (setq *baz* (lambda () (bar len) data)))) > (defun foo () > (bar 1000) > (dotimes (_ 10000) > (funcall *baz*))) > (profiler-start (quote cpu)) > (foo))' Could we park or clamp the arena while profiling?