From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: MPS: profiler Date: Fri, 21 Jun 2024 09:19:49 +0200 Message-ID: <87tthm3gq2.fsf@gmail.com> References: <87v823xvq1.fsf@localhost> <86cyobmmhc.fsf@gnu.org> <87r0crxung.fsf@localhost> <87le2zxsqx.fsf@localhost> <8634p6n7jd.fsf@gnu.org> 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="3802"; 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: Gerd =?utf-8?Q?M=C3=B6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jun 21 09:20:12 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 1sKYZ9-0000iC-V0 for ged-emacs-devel@m.gmane-mx.org; Fri, 21 Jun 2024 09:20:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sKYYt-0002PO-Tm; Fri, 21 Jun 2024 03:19:55 -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 1sKYYs-0002PC-2c for emacs-devel@gnu.org; Fri, 21 Jun 2024 03:19:54 -0400 Original-Received: from mail-ed1-x534.google.com ([2a00:1450:4864:20::534]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sKYYq-0008D9-Dx; Fri, 21 Jun 2024 03:19:53 -0400 Original-Received: by mail-ed1-x534.google.com with SMTP id 4fb4d7f45d1cf-57d044aa5beso1781841a12.2; Fri, 21 Jun 2024 00:19:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718954390; x=1719559190; 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=Xs3snfwXeNOL6l6R35ap+f7uiLG3k43NkfnNQYaMjmY=; b=nAoNjMQpgQ5iSHu49vKYIooRXvuOpiVcWXP5C1LrdEY/BA1+T0wLv14L8LR6XxqSMJ WbtlSmBIpfguNTcO2slne4jHx1QrlTFSG2FMFBKQXAVWAB7MhBos2faLbdUVaCw+cw7w AryqClGCHE0o/oXH4x9ChFAy86bSwQA4yUPfJfxRPlfGuYgtA5tj512YcZXGW7YQpTyY MBw6jVt5suWOonPYHpS0R++l3FwDiArvD5nxvBo5GK5Tv/lnIltyhuwCq+8SCdDs+LK0 c1zGZIPrz24lZT7AioUvrcIKX9GUwkGXnlyT9vb6SQ1hNhAAYLo0sxq4+IhGRvl8M0Qy 2ihg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718954390; x=1719559190; 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=Xs3snfwXeNOL6l6R35ap+f7uiLG3k43NkfnNQYaMjmY=; b=gn692LZmvwGS+mUwzHpiOV5WV6zD8rbKjeqIS61ZOMhUp4Q/eu1ccNgn7bV6V/9yhq NfdzkRxAe9ecNwY135GPzZembRTaMZQQ9PhgEovjOk5zISyKotY8a7PrJCcgs4hvw8D0 bzBGVFOkYwiNEyT+xnNW1NXsHaouQ/Wk0RWtKF/iMu+PchJOVLa4LKLBYooBrNLvkCMo j/1aQCRkJRSjHGj4jII26+qZQYWZBCF5mLqxWStTrm5RryHmaWceImCkhqcNpzj/3+92 fer1jy7DDhUAsBeJHwlSem+J9zl7cXiZX+9WHSNOagWOYKsUiAli6W4NYqrve84v8Nty GrvQ== X-Forwarded-Encrypted: i=1; AJvYcCWPuTpRqWb6pXn09vnZXeRFLaS27uYPlM9qokEIllYlda5jpqDCyA98kXIi0sjUd97ARlTIuFhtA78W6Y10ZC2FxEU1 X-Gm-Message-State: AOJu0Yz37SLnxWfJz06k3wdKG4ZeFPdteBCt4F+OzT8cyWHbDzjrWKmm UTKbeQSCzxVXFWE6jEytiNjzSfSNK1IOPZQCdRKAF8/OVNpOysmfSfNHtg== X-Google-Smtp-Source: AGHT+IG8tqyIjftwIVzSGOXyBx7KUdrWk2F+Kuv9FT18I/DTPgewunZynxUkK+zRqAx0otDoaCwIgg== X-Received: by 2002:aa7:d0d7:0:b0:57d:10bb:4588 with SMTP id 4fb4d7f45d1cf-57d10bb4608mr3199656a12.41.1718954390171; Fri, 21 Jun 2024 00:19:50 -0700 (PDT) Original-Received: from caladan ([31.177.116.19]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57d3053510asm534528a12.74.2024.06.21.00.19.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Jun 2024 00:19:49 -0700 (PDT) In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llman?= =?utf-8?Q?n=22's?= message of "Fri, 21 Jun 2024 08:54:34 +0200") Received-SPF: pass client-ip=2a00:1450:4864:20::534; envelope-from=eller.helmut@gmail.com; helo=mail-ed1-x534.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:320365 Archived-At: 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. 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))'