René's URL Explorer Experiment


Title: F-stack kernel failing to track time properly · Issue #701 · F-Stack/f-stack · GitHub

Open Graph Title: F-stack kernel failing to track time properly · Issue #701 · F-Stack/f-stack

X Title: F-stack kernel failing to track time properly · Issue #701 · F-Stack/f-stack

Description: Steps to reproduce: clone latest code from github, build and install compile and run the attached code Explanation of issue being shown: Very first log value is from me being lazy in the sample code, logs after that are during boot, mult...

Open Graph Description: Steps to reproduce: clone latest code from github, build and install compile and run the attached code Explanation of issue being shown: Very first log value is from me being lazy in the sample cod...

X Description: Steps to reproduce: clone latest code from github, build and install compile and run the attached code Explanation of issue being shown: Very first log value is from me being lazy in the sample cod...

Opengraph URL: https://github.com/F-Stack/f-stack/issues/701

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"F-stack kernel failing to track time properly","articleBody":"Steps to reproduce:\r\n1. clone latest code from github, build and install\r\n2. compile and run the attached code\r\n\r\nExplanation of issue being shown: Very first log value is from me being lazy in the sample code, logs after that are during boot, multiple callouts get delayed and batched so they are very close to each other. something to do with freebsd.expire being too far ahead for first trigger, increasing boot.hz seems to decrease the delay but besides the point that's a small issue.  \r\nNext logs show that if callout is registered via EVFILT_TIMER very close to boot time, it is able to trigger every 1 second.\r\nAfter it updates/adds a timer further away from boot, however, it deviates a lot.\r\nIt also for some reason has its units way off - I had to ask it to interpret my argument as 1 nanosecond(s) for it to track 1 second.\r\n\r\nExpected behavior: to track time properly regardless of when callout is added, and to correctly interpret the units specified.\r\n\r\nI tried to debug a bit, but could not figure out a solution - seems like maybe something to do with sbinuptime() and tick_sbt not matching. I am unsure if this bug is limited to EVFILT_TIMER or how many other subsystems are affected, clearly it can track time under some circumstances.\r\n\r\n```\r\nADD/UPDATE TIMER\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=45185.574288\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.032788\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.033428\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.033980\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.091014\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.999392\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.999392\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.999391\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.999392\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=0.999391\r\nADD/UPDATE TIMER\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219578\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219578\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219578\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219579\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219578\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219577\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219586\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219569\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219578\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=6.219579\r\nADD/UPDATE TIMER\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=68.416336\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=68.416337\r\nTRIGGER ident=1000000 data=1 fflags=0 since_last=68.416335\r\n...\r\n```\r\n\r\n```c\r\n#include \u003cbits/time.h\u003e\r\n#include \u003cerrno.h\u003e\r\n#include \u003cff_api.h\u003e\r\n#include \u003cgeneric/rte_cycles.h\u003e\r\n#include \u003cstdio.h\u003e\r\n#include \u003cstring.h\u003e\r\n#include \u003ctime.h\u003e\r\n#include \u003cunistd.h\u003e\r\n\r\n#define MAX_EVENTS 8 /* max events to return on a kevent() call */\r\n\r\nstatic struct kevent events[MAX_EVENTS];\r\nstatic int kq;\r\n\r\ndouble get_ns() {\r\n\tstruct timespec ts;\r\n\tclock_gettime(CLOCK_MONOTONIC, \u0026ts);\r\n\treturn 1e9L * ts.tv_sec + ts.tv_nsec;\r\n}\r\n\r\nstatic void add_or_update_timer() {\r\n\tprintf(\"ADD/UPDATE TIMER\\n\");\r\n\r\n\tstruct kevent kev;\r\n\tEV_SET(\u0026kev, 1000000, EVFILT_TIMER, EV_ADD, NOTE_NSECONDS, 1, NULL);\r\n\tif (ff_kevent(kq, \u0026kev, 1, NULL, 0, NULL) == -1) {\r\n\t\tprintf(\"ff_kevent error:%d, %s\\n\", errno, strerror(errno));\r\n\t}\r\n}\r\n\r\nstatic int loop(void __attribute((unused)) * arg) {\r\n\tstatic uint32_t ntrigs = 0;\r\n\tstatic double last_ns = 0;\r\n\r\n\tint nevents = ff_kevent(kq, NULL, 0, events, MAX_EVENTS, NULL);\r\n\tif (nevents == -1) {\r\n\t\tperror(\"loop::ff_kevent()\");\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tfor (int i = 0; i \u003c nevents; i++) {\r\n\t\tstruct kevent event = events[i];\r\n\r\n\t\tif (event.filter == EVFILT_TIMER) {\r\n\t\t\tdouble ns = get_ns();\r\n\t\t\tprintf(\"TRIGGER ident=%lu data=%ld fflags=%d since_last=%f\\n\", event.ident,\r\n\t\t\t\t   event.data, event.fflags, (ns - last_ns) / NS_PER_S);\r\n\t\t\tlast_ns = ns;\r\n\r\n\t\t\tif (++ntrigs == 10) {\r\n\t\t\t\tadd_or_update_timer();\r\n\t\t\t\tntrigs = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\treturn 0;\r\n}\r\n\r\nint main(int argc, char *argv[]) {\r\n\tif (ff_init(argc, argv) != 0) {\r\n\t\tfprintf(stderr, \"Failed to ff_init(%d): %s\\n\", errno, strerror(errno));\r\n\t\treturn 1;\r\n\t}\r\n\r\n\tkq = ff_kqueue();\r\n\tif (kq == -1) {\r\n\t\tfprintf(stderr, \"Failed to kqueue(%d): %s\\n\", errno, strerror(errno));\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tadd_or_update_timer();\r\n\r\n\tff_run(loop, NULL);\r\n\r\n\treturn 1;\r\n}\r\n```","author":{"url":"https://github.com/MrSonicMaster","@type":"Person","name":"MrSonicMaster"},"datePublished":"2022-10-13T07:12:14.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/701/f-stack/issues/701"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:3fd1883f-869f-920c-afb3-21dd3e37998a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC71C:495C0:58FCAC:775C66:6969726B
html-safe-noncebe053485da3c72093d27b8f5143857ff79564bad25cd3de224134274261fb8f4
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNzFDOjQ5NUMwOjU4RkNBQzo3NzVDNjY6Njk2OTcyNkIiLCJ2aXNpdG9yX2lkIjoiMTU1MTM4MjQzMjkyNzI4MTc3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac69caaf0c1cee87f52fb736e720c82d91102633d85ea721969d3c92bf262e3a2b
hovercard-subject-tagissue:1407269466
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/F-Stack/f-stack/701/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d4404d571ebcbd97915d40bf8a5429f3fef1f2a709c2f6d55e5b86527a0f813b/F-Stack/f-stack/issues/701
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d4404d571ebcbd97915d40bf8a5429f3fef1f2a709c2f6d55e5b86527a0f813b/F-Stack/f-stack/issues/701
og:image:altSteps to reproduce: clone latest code from github, build and install compile and run the attached code Explanation of issue being shown: Very first log value is from me being lazy in the sample cod...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameMrSonicMaster
hostnamegithub.com
expected-hostnamegithub.com
Nonec6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881
turbo-cache-controlno-preview
go-importgithub.com/F-Stack/f-stack git https://github.com/F-Stack/f-stack.git
octolytics-dimension-user_id26062241
octolytics-dimension-user_loginF-Stack
octolytics-dimension-repository_id88224621
octolytics-dimension-repository_nwoF-Stack/f-stack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id88224621
octolytics-dimension-repository_network_root_nwoF-Stack/f-stack
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseec4d88fbe7ed62446d90b0a6d8e6db4248a8f8b8
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/F-Stack/f-stack/issues/701#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FF-Stack%2Ff-stack%2Fissues%2F701
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FF-Stack%2Ff-stack%2Fissues%2F701
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=F-Stack%2Ff-stack
Reloadhttps://github.com/F-Stack/f-stack/issues/701
Reloadhttps://github.com/F-Stack/f-stack/issues/701
Reloadhttps://github.com/F-Stack/f-stack/issues/701
F-Stack https://github.com/F-Stack
f-stackhttps://github.com/F-Stack/f-stack
Notifications https://github.com/login?return_to=%2FF-Stack%2Ff-stack
Fork 953 https://github.com/login?return_to=%2FF-Stack%2Ff-stack
Star 4.2k https://github.com/login?return_to=%2FF-Stack%2Ff-stack
Code https://github.com/F-Stack/f-stack
Issues 306 https://github.com/F-Stack/f-stack/issues
Pull requests 0 https://github.com/F-Stack/f-stack/pulls
Actions https://github.com/F-Stack/f-stack/actions
Projects 0 https://github.com/F-Stack/f-stack/projects
Wiki https://github.com/F-Stack/f-stack/wiki
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/F-Stack/f-stack/security
Please reload this pagehttps://github.com/F-Stack/f-stack/issues/701
Insights https://github.com/F-Stack/f-stack/pulse
Code https://github.com/F-Stack/f-stack
Issues https://github.com/F-Stack/f-stack/issues
Pull requests https://github.com/F-Stack/f-stack/pulls
Actions https://github.com/F-Stack/f-stack/actions
Projects https://github.com/F-Stack/f-stack/projects
Wiki https://github.com/F-Stack/f-stack/wiki
Security https://github.com/F-Stack/f-stack/security
Insights https://github.com/F-Stack/f-stack/pulse
New issuehttps://github.com/login?return_to=https://github.com/F-Stack/f-stack/issues/701
New issuehttps://github.com/login?return_to=https://github.com/F-Stack/f-stack/issues/701
F-stack kernel failing to track time properlyhttps://github.com/F-Stack/f-stack/issues/701#top
questionhttps://github.com/F-Stack/f-stack/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com/MrSonicMaster
https://github.com/MrSonicMaster
MrSonicMasterhttps://github.com/MrSonicMaster
on Oct 13, 2022https://github.com/F-Stack/f-stack/issues/701#issue-1407269466
questionhttps://github.com/F-Stack/f-stack/issues?q=state%3Aopen%20label%3A%22question%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.