Skip to content

Conversation

@mgudaram
Copy link
Contributor

No description provided.

@mgudaram mgudaram force-pushed the Logging branch 3 times, most recently from d419cc8 to 1657771 Compare October 29, 2025 20:43
Comment on lines 57 to 71
#[cfg(feature = "vmcall-raw")]
static NUM_VCPUS: AtomicU32 = AtomicU32::new(0);

#[cfg(feature = "vmcall-raw")]
static LOGAREA_CREATED: AtomicBool = AtomicBool::new(false);

#[cfg(feature = "vmcall-raw")]
static LOGAREA_INITIALIZED: AtomicBool = AtomicBool::new(false);

#[cfg(feature = "vmcall-raw")]
static LOGENTRY_ID: AtomicU64 = AtomicU64::new(0);

#[cfg(feature = "vmcall-raw")]
static MAXLOGLEVEL: AtomicU8 = AtomicU8::new(0);

Copy link
Contributor

Choose a reason for hiding this comment

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

can we create a data structure to include all logging related items?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can we create a data structure to include all logging related items?

I moved them into a data structure in logging.rs

@jyao1
Copy link
Contributor

jyao1 commented Oct 30, 2025

Please clarify how you do the unit test. If you have covered all corner cases, including

  • log first
  • log with enough space in the end
  • log without enough space in the end and with enough space from the head
  • log without enough space in the end and even without enough space from the head
  • ...

Comment on lines 562 to 563
#[cfg(feature = "vmcall-raw")]
pub fn create_logarea() -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we move all logging related feature to a separate log.rs file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

can we move all logging related feature to a separate log.rs file?

sure jiewen, since session.rs uses existing crate log::, is it okay to rename the file to logging.rs? it would help resolve any future confusions.

Copy link
Contributor

Choose a reason for hiding this comment

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

My recommendation is:

  1. Keep old sesson.rs.
  2. Create a new logging.rs and put all logging related definition/function there.
  3. The rest file just call the logging interface in logging.rs.

@mgudaram
Copy link
Contributor Author

Please clarify how you do the unit test. If you have covered all corner cases, including

  • log first
  • log with enough space in the end
  • log without enough space in the end and with enough space from the head
  • log without enough space in the end and even without enough space from the head
  • ...

On my end, I have run ~50 migrations with logging using loopback mechanism. Few migrations exhaust the circular buffer. I will look into adding unit test support in the logging.rs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants