Skip to content

add a plugin_v1 example#236

Merged
1a1a11a merged 1 commit intodevelopfrom
1a1a11a/plugin_v1
Jun 26, 2025
Merged

add a plugin_v1 example#236
1a1a11a merged 1 commit intodevelopfrom
1a1a11a/plugin_v1

Conversation

@1a1a11a
Copy link
Copy Markdown
Owner

@1a1a11a 1a1a11a commented Jun 26, 2025

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.

@1a1a11a 1a1a11a requested a review from Copilot June 26, 2025 02:41
@1a1a11a 1a1a11a requested a review from haochengxia as a code owner June 26, 2025 02:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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);
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
cache->evict = plugin_lru_evict;
cache->remove = plugin_lru_remove;

plugin_lru_params_t *params = malloc(sizeof(plugin_lru_params_t));
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

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

Consider checking the return value of malloc to ensure that memory allocation was successful, which helps avoid potential crashes.

Copilot uses AI. Check for mistakes.
@1a1a11a 1a1a11a merged commit d109a01 into develop Jun 26, 2025
11 of 12 checks passed
@1a1a11a 1a1a11a deleted the 1a1a11a/plugin_v1 branch June 26, 2025 02:54
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.

3 participants