From nobody Mon Mar 11 21:46:47 2024 X-Original-To: dev-commits-ports-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ttr2d15fQz5CY7H; Mon, 11 Mar 2024 21:46:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ttr2b749cz45Kq; Mon, 11 Mar 2024 21:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710193608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DVLk2bPgupzfUjJXkBdlw3Ie+87FfEtjTkqOQ6QtmLQ=; b=s/1BZnecz6ezf/Pe+KFrZrC7qRgOAWk+eCDwacb1zsX4HsFB3vb6qSIMPByxm+NHFsXlAy 3lTwQSG8HzJVMPixLJMzvPb5WuqjHSp5XDzfVNjRaJlVnWMiHlPat1Iyg6A6ubodEFemX0 3l1aRPOjeu52lM6hjNnk5PFHccbL2mZQKA6f6qWChkvHDjfA084bAQVYexEsuSA+jbLinK P+oCQj7fuvlbRUw3qLclIQqr6A8C0L6HtW8udu8jy7svQp0/iG7fDLcbU35EZNy5DSyuXG sLfGabhkL+eHCpBgrKWMd2+vEb6U+A3skxJ30saDH+wrdPOEGeriYRtWYBtjHg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1710193608; a=rsa-sha256; cv=none; b=cHabFCnhzh854mk6wqBP8R1/Zsb9onLcv6GTZ5td/DX2m+xZrhXB+87NZ2LUJyJbw4UBA0 a/SSPL35PKk25a1rB3vw2KFV3B0WGAASxZZZ2igWqkpxGZ/CE3S7ZHkAZtVsc1HLsmcVW8 pb/Ki+A/fF+EOURS9qyD2rGlVrTWQdNME7uXHnHGV+25e8yYFZOC3ortHUvoFt07crQgy9 Kh0xt2wV/Cunx9XFH268jkJYHODUX2QZqudA09FNjsNICGmenOJ8Ma/lScNZZfNE38KElb QgzJwQngunJnJFXEAzezoG5R6SsafNzy5+cAVdmTaO9nf845Z4KFzKT24sVmrA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1710193608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DVLk2bPgupzfUjJXkBdlw3Ie+87FfEtjTkqOQ6QtmLQ=; b=rDnSlXv41OH7ELVE7OPWo0TVMe+ipCi+E/G6OrbNDMh1tKFP2gMtBRoP1n71EX1EjF7+H1 WE+04RutHz3JjlzNNx/R6KGqhg2vg3e5OTYn/m0CLo7qIwG7L5VqotbyIJaaUmh4RjROJ4 4Rn58VBRcJuq79DijIU4WcmxJ1Q3196j39vjYMVJlyGN0zCe49shUsCJdLXz1vikF6QFLa NUqOKRck5I1egpPj+gTZcKh0seFXC4Q7AyPomD3MTUAz8KT8qiXtC0S59VAAAemNRuRx9U XTMuj9szMpjqVf3ODrBUdEGdKsiJh5IJTJD1dtO2224b6rFQaMpaeY4PEuAdzg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Ttr2b6fkQzmjG; Mon, 11 Mar 2024 21:46:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 42BLkldU059915; Mon, 11 Mar 2024 21:46:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42BLklBZ059912; Mon, 11 Mar 2024 21:46:47 GMT (envelope-from git) Date: Mon, 11 Mar 2024 21:46:47 GMT Message-Id: <202403112146.42BLklBZ059912@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Christoph Moench-Tegeder Subject: git: ce4b93a6ad07 - 2024Q1 - www/firefox-esr: fix process display in about::support List-Id: Commits to the quarterly branches of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-branches@freebsd.org X-BeenThere: dev-commits-ports-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: cmt X-Git-Repository: ports X-Git-Refname: refs/heads/2024Q1 X-Git-Reftype: branch X-Git-Commit: ce4b93a6ad073cd1cdcf121ea2e77fd59d3919c7 Auto-Submitted: auto-generated The branch 2024Q1 has been updated by cmt: URL: https://cgit.FreeBSD.org/ports/commit/?id=ce4b93a6ad073cd1cdcf121ea2e77fd59d3919c7 commit ce4b93a6ad073cd1cdcf121ea2e77fd59d3919c7 Author: Christoph Moench-Tegeder AuthorDate: 2024-03-11 21:36:49 +0000 Commit: Christoph Moench-Tegeder CommitDate: 2024-03-11 21:45:49 +0000 www/firefox-esr: fix process display in about::support same patch as in www/firefox PR: 277159 Reported By: Lars Herschke (cherry picked from commit 23fdb13510f59f2b4c473c0cc715e08d7cc63c6c) --- ...toolkit_components_processtools_procinfo__bsd.c | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/www/firefox-esr/files/patch-toolkit_components_processtools_procinfo__bsd.c b/www/firefox-esr/files/patch-toolkit_components_processtools_procinfo__bsd.c new file mode 100644 index 000000000000..e2e9a3cc88f4 --- /dev/null +++ b/www/firefox-esr/files/patch-toolkit_components_processtools_procinfo__bsd.c @@ -0,0 +1,104 @@ +diff --git toolkit/components/processtools/ProcInfo_bsd.cpp toolkit/components/processtools/ProcInfo_bsd.cpp +index a6ff4881940c..f041ed5e50ce 100644 +--- toolkit/components/processtools/ProcInfo_bsd.cpp ++++ toolkit/components/processtools/ProcInfo_bsd.cpp +@@ -18,6 +18,9 @@ + #include + #include + #include ++#ifdef __FreeBSD__ ++#include ++#endif + + namespace mozilla { + +@@ -50,25 +53,39 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync( + } + for (const auto& request : aRequests) { + size_t size; ++#ifdef __FreeBSD__ ++ int mib[4]; ++ int mibsize = 4; ++ mib[0] = CTL_KERN; ++ mib[1] = KERN_PROC; ++ mib[2] = KERN_PROC_PID | KERN_PROC_INC_THREAD; ++ mib[3] = request.pid; ++#else + int mib[6]; ++ int mibsize = 6; + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PID | KERN_PROC_SHOW_THREADS; + mib[3] = request.pid; + mib[4] = sizeof(kinfo_proc); + mib[5] = 0; +- if (sysctl(mib, 6, nullptr, &size, nullptr, 0) == -1) { ++#endif ++ if (sysctl(mib, mibsize, nullptr, &size, nullptr, 0) == -1) { + // Can't get info for this process. Skip it. + continue; + } + ++#ifdef __FreeBSD__ ++ auto procs = MakeUniqueFallible(size / sizeof(kinfo_proc)); ++#else + mib[5] = size / sizeof(kinfo_proc); + auto procs = MakeUniqueFallible(mib[5]); ++#endif + if (!procs) { + result.SetReject(NS_ERROR_OUT_OF_MEMORY); + return result; + } +- if (sysctl(mib, 6, procs.get(), &size, nullptr, 0) == -1 && ++ if (sysctl(mib, mibsize, procs.get(), &size, nullptr, 0) == -1 && + errno != ENOMEM) { + continue; + } +@@ -84,19 +101,34 @@ ProcInfoPromise::ResolveOrRejectValue GetProcInfoSync( + bool found = false; + for (size_t i = 0; i < size / sizeof(kinfo_proc); i++) { + const auto& p = procs[i]; ++#ifdef __FreeBSD__ ++ if (i == 0) { ++#else + if (p.p_tid == -1) { ++#endif + // This is the process. + found = true; ++#ifdef __FreeBSD__ ++ info.cpuTime = uint64_t(p.ki_runtime) * 1'000u; ++ info.memory = (p.ki_tsize + p.ki_dsize + p.ki_ssize) * getpagesize(); ++#else + info.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u + + uint64_t(p.p_rtime_usec) * 1'000u; + info.memory = + (p.p_vm_tsize + p.p_vm_dsize + p.p_vm_ssize) * getpagesize(); ++#endif ++ + } else { + // This is one of its threads. + ThreadInfo threadInfo; ++#ifdef __FreeBSD__ ++ threadInfo.tid = p.ki_tid; ++ threadInfo.cpuTime = uint64_t(p.ki_runtime) * 1'000u; ++#else + threadInfo.tid = p.p_tid; + threadInfo.cpuTime = uint64_t(p.p_rtime_sec) * 1'000'000'000u + + uint64_t(p.p_rtime_usec) * 1'000u; ++#endif + info.threads.AppendElement(threadInfo); + } + } +diff --git toolkit/components/processtools/moz.build toolkit/components/processtools/moz.build +index b7c164c1b0ac..a41dad52c343 100644 +--- toolkit/components/processtools/moz.build ++++ toolkit/components/processtools/moz.build +@@ -39,7 +39,7 @@ BROWSER_CHROME_MANIFESTS += ["tests/browser/browser.ini"] + # Platform-specific implementations of `ProcInfo`. + toolkit = CONFIG["MOZ_WIDGET_TOOLKIT"] + if toolkit == "gtk" or toolkit == "android": +- if CONFIG["OS_TARGET"] == "OpenBSD": ++ if CONFIG["OS_TARGET"] == "FreeBSD" or CONFIG["OS_TARGET"] == "OpenBSD": + UNIFIED_SOURCES += ["ProcInfo_bsd.cpp"] + else: + UNIFIED_SOURCES += ["ProcInfo_linux.cpp"]