Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds an example demonstrating how to use plugin v1 for cache simulation while noting limited future investment in v1.
- Changes the internal cache logging from VERBOSE to INFO in libCacheSim.
- Adds example files for plugin v1 including a test program and the plugin_lru implementation.
- Introduces a CMakeLists.txt for building the plugin v1 example.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| libCacheSim/cache/plugin.c | Updated logging level for internal cache loading |
| example/plugin_v1/test_plugin.c | Added test program demonstrating plugin v1 usage |
| example/plugin_v1/plugin_lru.c | Added plugin_lru implementation for the plugin v1 |
| example/plugin_v1/CMakeLists.txt | Added build configuration for the plugin v1 example |
| } | ||
|
|
||
| VERBOSE("internal cache %s loaded\n", cache_alg_name); | ||
| INFO("internal cache %s loaded\n", cache_alg_name); |
There was a problem hiding this comment.
Changing the log level from VERBOSE to INFO may alter the intended logging verbosity; please confirm that this adjustment aligns with the overall logging strategy.
| cache->evict = plugin_lru_evict; | ||
| cache->remove = plugin_lru_remove; | ||
|
|
||
| plugin_lru_params_t *params = malloc(sizeof(plugin_lru_params_t)); |
There was a problem hiding this comment.
Consider checking the return value of malloc to ensure that memory allocation was successful, which helps avoid potential crashes.
haochengxia
approved these changes
Jun 26, 2025
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.
Add an example of how to use plugin v1. However, we do not plan to further invest in v1 as it is hard to use.