Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a log buffer to store log messages. #52

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Commits on Oct 18, 2024

  1. utils: Add a StringRingBuffer implementation

    The log buffer is implemented using a ring buffer that contains the
    characters within log entries. This patch introduces a generic
    StringRingBuffer that can be used for safely managing the contents of
    strings within a ring buffer that is suitable for use with the log
    buffer. This separates the ring buffer implementation from the log and
    allows implementation of ring buffer specific unit testing, which is
    included within this patch.
    
    Signed-off-by: Vasant Karasulli <[email protected]>
    Signed-off-by: Roy Hopkins <[email protected]>
    vsntk18 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    cda4523 View commit details
    Browse the repository at this point in the history
  2. Implement a log buffer which stores all log messages in memory

    This log buffer is based on the string ring buffer in
    utils/StringRingBuffer.
    
    Signed-off-by: Vasant Karasulli <[email protected]>
    vsntk18 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    2eba737 View commit details
    Browse the repository at this point in the history
  3. Implement a percpu line buffer to store the individual log messages

    Each individual log message gets written into the global log buffer
    from the percpu line buffer.
    
    Signed-off-by: Vasant Karasulli <[email protected]>
    vsntk18 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    a99fbe2 View commit details
    Browse the repository at this point in the history
  4. Initialize log buffer and migrate it from stage2 to svsm kernel

    Introduce a new struct MigrateInfo which contains the data to
    be migrated from stage2 to svsm kernel.
    
    Signed-off-by: Vasant Karasulli <[email protected]>
    vsntk18 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    64e6023 View commit details
    Browse the repository at this point in the history
  5. Add a feature named enable-console-log

    This feature can be used to enable printing log messages to
    console in addition to storing them in the log buffer.
    
    Use ENABLE_CONSOLE_LOG=1 to enable this feature. By default,
    this feature is disabled for release builds and enabled for
    debug builds.
    
    Signed-off-by: Vasant Karasulli <[email protected]>
    vsntk18 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    971a443 View commit details
    Browse the repository at this point in the history
  6. log_buffer: add unit tests to test the functionality

    Test the log_buffer by calling methods like write_log()
    and read_log().
    
    Signed-off-by: Vasant Karasulli <[email protected]>
    vsntk18 committed Oct 18, 2024
    Configuration menu
    Copy the full SHA
    45c52f8 View commit details
    Browse the repository at this point in the history