') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ', 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); [release/7.0] Use CLOCK_BOOTTIME to calculate BootTime on linux (#67589) by simonrozsival · Pull Request #83966 · dotnet/runtime · GitHub
Skip to content

[release/7.0] Use CLOCK_BOOTTIME to calculate BootTime on linux (#67589) - #83966

Merged
simonrozsival merged 4 commits into
dotnet:release/7.0-stagingfrom
simonrozsival:backport/pr-67589-to-release/7.0
Mar 31, 2023
Merged

[release/7.0] Use CLOCK_BOOTTIME to calculate BootTime on linux (#67589)#83966
simonrozsival merged 4 commits into
dotnet:release/7.0-stagingfrom
simonrozsival:backport/pr-67589-to-release/7.0

Conversation

@simonrozsival

@simonrozsivalsimonrozsival commented Mar 27, 2023

Copy link
Copy Markdown
Member

Backport of #67589 and #75334 to release/7.0

/cc @am11@adamsitnik

Customer impact

A customer reported that they can't use the Process.StartTime API in their Android app (#83816). The problem is that recent Android versions don't allow reading the /proc/stat file anymore. Instead, we use the clock_gettime libc function.

This bug as already been fixed in .NET 8 but we didn't backport it to .NET 7.0 at that time.

Fixes#83816

Testing

Manual testing and unit tests.

Risk

Low. The fix is well tested.

dotnet-maestroBotand others added 2 commits March 23, 2023 17:34
…23.1 (dotnet#83860)
Microsoft.NET.Workload.Emscripten.net6.Manifest-7.0.100 , Microsoft.NET.Workload.Emscripten.net7.Manifest-7.0.100
From Version 7.0.4 -> To Version 7.0.5
Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Adam Sitnik <adam.sitnik@gmail.com>
Co-authored-by: Jeff Handley <jeffhandley@users.noreply.github.com>
Co-authored-by: Simon Rozsival <simon@rozsival.com>
@simonrozsivalsimonrozsival added Servicing-consider Issue for next servicing release review area-System.Diagnostics.Process labels Mar 27, 2023
@simonrozsivalsimonrozsival added this to the 7.0.x milestone Mar 27, 2023
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/area-system-diagnostics-process
See info in area-owners.md if you want to be subscribed.

Issue Details

Backport of #67589 to release/7.0

/cc @am11@adamsitnik

Customer impact

A customer reported that they can't use the Process.StartTime API in their Android app (#83816). The problem is that recent Android versions don't allow reading the /proc/stat file anymore. Instead, we use the clock_gettime libc function.

This bug as already been fixed in .NET 8 but we didn't backport it to .NET 7.0 at that time.

Fixes #83816

Testing

Manual testing and unit tests.

Risk

Low. The fix is well tested.

Author:simonrozsival
Assignees:-
Labels:

Servicing-consider, area-System.Diagnostics.Process

Milestone:7.0.x

@adamsitnik

Copy link
Copy Markdown
Member

The CI failures seem related:

 System.Diagnostics.Tests.ProcessTests.GetProcessesByName_ProcessName_ReturnsExpected [FAIL]
Assert.All() Failure: 2 out of 3 items in the collection did not pass.
[2]: Item: System.Diagnostics.Process (dotnet)
Xunit.Sdk.EqualException: Assert.Equal() Failure
Expected: 2023-03-27T11:42:32.5574906+00:00
Actual: 2023-03-27T11:42:49.6041245+00:00
at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 96
at Xunit.Assert.Equal[T](T expected, T actual) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 63
at System.Diagnostics.Tests.ProcessTests.<>c__DisplayClass90_0.<GetProcessesByName_ProcessName_ReturnsExpected>b__3(Process process) in /_/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs:line 1250
at Xunit.Assert.All[T](IEnumerable`1 collection, Action`2 action) in /_/src/xunit.assert/Asserts/CollectionAsserts.cs:line 77
[1]: Item: System.Diagnostics.Process (dotnet)
Xunit.Sdk.EqualException: Assert.Equal() Failure
Expected: 2023-03-27T11:42:32.5574906+00:00
Actual: 2023-03-27T11:42:49.2332694+00:00
at Xunit.Assert.Equal[T](T expected, T actual, IEqualityComparer`1 comparer) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 96
at Xunit.Assert.Equal[T](T expected, T actual) in /_/src/xunit.assert/Asserts/EqualityAsserts.cs:line 63
at System.Diagnostics.Tests.ProcessTests.<>c__DisplayClass90_0.<GetProcessesByName_ProcessName_ReturnsExpected>b__3(Process process) in /_/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs:line 1250
at Xunit.Assert.All[T](IEnumerable`1 collection, Action`2 action) in /_/src/xunit.assert/Asserts/CollectionAsserts.cs:line 77
Stack Trace:
/_/src/libraries/System.Diagnostics.Process/tests/ProcessTests.cs(1250,0): at System.Diagnostics.Tests.ProcessTests.GetProcessesByName_ProcessName_ReturnsExpected()
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)

@am11

am11 commented Mar 27, 2023

Copy link
Copy Markdown
Member

We would need to backport #75334 as well.

@adamsitnikadamsitnik left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for backporting both PRs @simonrozsival !

@simonrozsival

Copy link
Copy Markdown
MemberAuthor

@rbhandarbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Mar 28, 2023
@rbhandarbhanda modified the milestones: 7.0.x, 7.0.6Mar 28, 2023
@carlossanlop

Copy link
Copy Markdown
Contributor

I'm retargeting this PR to the new release/7.0-staging branch, which is the one that we will use from now on for servicing fixes.

Repo maintainers will now be allowed to merge their own servicing PR as long as it meets the requirements:

  • It is approved by Tactics (signaled by adding the Servicing-approved label).
  • It's signed-off by an area owner.
  • The CI is green, or the failures are investigated as unrelated.
  • And if the PR touches an OOB package, the necessary OOB authoring changes are added.

The new process is described here: runtime/docs/project/library-servicing.md.

The infra team will be actively monitoring servicing PRs to ensure all requirements are met and to help with any issues.

Let me know if you have any questions.

@carlossanlop
carlossanlop changed the base branch from release/7.0 to release/7.0-stagingMarch 28, 2023 21:03
@simonrozsival

Copy link
Copy Markdown
MemberAuthor

Thanks, @carlossanlop.

@simonrozsival

Copy link
Copy Markdown
MemberAuthor

@simonrozsival

Copy link
Copy Markdown
MemberAuthor

@carlossanlop I believe all the requirements for merging the backport PR have been met so I'm merging it now.

@simonrozsival
simonrozsival merged commit fa133ae into dotnet:release/7.0-stagingMar 31, 2023
@ghostghost locked as resolved and limited conversation to collaborators Apr 30, 2023
@rbhandarbhanda modified the milestones: 7.0.6, 7.0.7Jun 1, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@simonrozsival@adamsitnik@am11@carlossanlop@rbhanda