Conversation
093d149 to
c22b1f8
Compare
Closed
nicholasberlin
approved these changes
Nov 3, 2025
| * add one anyway for users that screw up. | ||
| */ | ||
| alloc_len = sizeof(*qtty) + data_len + 1; /* extra for NUL */ | ||
| if ((qtty = calloc(1, alloc_len)) == NULL) |
Contributor
There was a problem hiding this comment.
we're overwriting all the data ... malloc is probably a little faster.
Collaborator
Author
There was a problem hiding this comment.
good point, I'll change
This forwards tty writes as a quark event, some notes: We should do our own tty aggregation, possibly also aggregating within a fork+exec. sudo traps the output of the child process and then forwards to the actual stdout, this means that under sudo the process that does the tty write is the parent of the actual process doing the write. This makes it difficult to filter our own output, meaning the first time we print something we get stuck in a self feeding loop. In the future we can add some logic to detect we are running under sudo, by checking the environment or maybe going up the tree and seeing if we are the child of a sudo process. Because of the sudo complication, I haven't added it to quark-mon(8) and/or quark_event_dump(), but there's a test. We don't get events for tty_writes when running on initramfs, so detect it and escape. It's likely that we don't have a pty and our code doesn't consider an actual tty? Needs more investigation.
haesbaert
added a commit
that referenced
this pull request
Nov 4, 2025
If you want btfhub you now have to build with WITH_BTFHUB=y. This cuts quark-mon from 7MB to 3MB and libquark_big.a from 13MB to 7MB. It's a bit clunky as we have to pass the option down to the container builds, but it works.
haesbaert
added a commit
that referenced
this pull request
Nov 4, 2025
If you want btfhub you now have to build with WITH_BTFHUB=y. This cuts quark-mon from 7MB to 3MB and libquark_big.a from 13MB to 7MB. It's a bit clunky as we have to pass the option down to the container builds, but it works.
haesbaert
added a commit
that referenced
this pull request
Nov 4, 2025
If you want btfhub you now have to build with WITH_BTFHUB=y. This cuts quark-mon from 7MB to 3MB and libquark_big.a from 13MB to 7MB. It's a bit clunky as we have to pass the option down to the container builds, but it works.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This forwards tty writes as a quark event, some notes:
We should do our own tty aggregation, possibly also aggregating within a fork+exec.
sudo traps the output of the child process and then forwards to the actual stdout, this means that under sudo the process that does the tty write is the parent of the actual process doing the write. This makes it difficult to filter our own output, meaning the first time we print something we get stuck in a self feeding loop.
In the future we can add some logic to detect we are running under sudo, by checking the environment or maybe going up the tree and seeing if we are the child of a sudo process.
Because of the sudo complication, I haven't added it to quark-mon(8) and/or quark_event_dump(), but there's a test.
We don't get events for tty_writes when running on initramfs, so detect it and
escape. It's likely that we don't have a pty and our code doesn't consider an
actual tty? Needs more investigation.
Issue #261