Caching information about definitions of differing macros#333
Merged
viktormalik merged 3 commits intodiffkemp:masterfrom May 23, 2024
Merged
Caching information about definitions of differing macros#333viktormalik merged 3 commits intodiffkemp:masterfrom
viktormalik merged 3 commits intodiffkemp:masterfrom
Conversation
PLukas2018
commented
Apr 20, 2024
viktormalik
reviewed
May 15, 2024
Collaborator
viktormalik
left a comment
There was a problem hiding this comment.
LGTM! Just a couple of nits and questions to clear up some things.
The `kind` informs about a kind of difference (macro, function-macro, macro-function, assembly).
dfb7cfa to
39c51ae
Compare
Create `CodeLocation` struct for storing information about an 'object' code location (filename and line). This struct could be also used for storing info about definition of differing macro in SyntaxDifference, function definitions, call locations, ... Also changed the type of line to unsigned which makes more sense.
The Simpll library now contains addition information for `SyntaxDifference` (respectively for macro difference) about definition of differing macros. The information is then stored from simpll yaml output to ComparisonGraph so it can be used later. This info will be useful for eg. visualising the difference in the code of macros in the result viewer.
39c51ae to
33abbc2
Compare
PLukas2018
added a commit
to PLukas2018/diffkemp
that referenced
this pull request
May 22, 2024
Eg. from this snippet of call stack ``` free_pages_prepare at mm/page_alloc.c:1273 PAGE_FLAGS_CHECK_AT_PREP (macro) at mm/page_alloc.c:1049 NR_PAGEFLAGS (macro) at ./include/linux/page-flags.h:759 ``` we are able to extract that `NR_PAGEFLAGS` is used from macro `PAGE_FLAGS_CHECK_AT_PREP` which is located in `./include/linux/page-flags.h` file and starts on line `759`. Note: If the `PAGE_FLAGS_CHECK_AT_PREP` was function the line `759` would meant line on which the `NR_PAGEFLAGS` macro is used, but because `PAGE_FLAGS_CHECK_AT_PREP` is macro and not a function it means line where the `PAGE_FLAGS_CHECK_AT_PREP` macro definition starts. For the last/differing macro in the call stack it is not possible to extract information about its definition from the call stack, but it can be extracted from `SyntaxDiff` in `ComparisonGraph` which includes info about the definition of differing macros from the call stacks (see PR diffkemp#333 for more info).
PLukas2018
added a commit
to PLukas2018/diffkemp
that referenced
this pull request
May 23, 2024
Eg. from this snippet of call stack ``` free_pages_prepare at mm/page_alloc.c:1273 PAGE_FLAGS_CHECK_AT_PREP (macro) at mm/page_alloc.c:1049 NR_PAGEFLAGS (macro) at ./include/linux/page-flags.h:759 ``` we are able to extract that `NR_PAGEFLAGS` is used from macro `PAGE_FLAGS_CHECK_AT_PREP` which is located in `./include/linux/page-flags.h` file and starts on line `759`. Note: If the `PAGE_FLAGS_CHECK_AT_PREP` was function the line `759` would meant line on which the `NR_PAGEFLAGS` macro is used, but because `PAGE_FLAGS_CHECK_AT_PREP` is macro and not a function it means line where the `PAGE_FLAGS_CHECK_AT_PREP` macro definition starts. For the last/differing macro in the call stack it is not possible to extract information about its definition from the call stack, but it can be extracted from `SyntaxDiff` in `ComparisonGraph` which includes info about the definition of differing macros from the call stacks (see PR diffkemp#333 for more info).
viktormalik
pushed a commit
that referenced
this pull request
May 23, 2024
Eg. from this snippet of call stack ``` free_pages_prepare at mm/page_alloc.c:1273 PAGE_FLAGS_CHECK_AT_PREP (macro) at mm/page_alloc.c:1049 NR_PAGEFLAGS (macro) at ./include/linux/page-flags.h:759 ``` we are able to extract that `NR_PAGEFLAGS` is used from macro `PAGE_FLAGS_CHECK_AT_PREP` which is located in `./include/linux/page-flags.h` file and starts on line `759`. Note: If the `PAGE_FLAGS_CHECK_AT_PREP` was function the line `759` would meant line on which the `NR_PAGEFLAGS` macro is used, but because `PAGE_FLAGS_CHECK_AT_PREP` is macro and not a function it means line where the `PAGE_FLAGS_CHECK_AT_PREP` macro definition starts. For the last/differing macro in the call stack it is not possible to extract information about its definition from the call stack, but it can be extracted from `SyntaxDiff` in `ComparisonGraph` which includes info about the definition of differing macros from the call stacks (see PR #333 for more info).
PLukas2018
added a commit
to PLukas2018/diffkemp
that referenced
this pull request
Aug 11, 2025
Eg. from this snippet of call stack ``` free_pages_prepare at mm/page_alloc.c:1273 PAGE_FLAGS_CHECK_AT_PREP (macro) at mm/page_alloc.c:1049 NR_PAGEFLAGS (macro) at ./include/linux/page-flags.h:759 ``` we are able to extract that `NR_PAGEFLAGS` is used from macro `PAGE_FLAGS_CHECK_AT_PREP` which is located in `./include/linux/page-flags.h` file and starts on line `759`. Note: If the `PAGE_FLAGS_CHECK_AT_PREP` was function the line `759` would meant line on which the `NR_PAGEFLAGS` macro is used, but because `PAGE_FLAGS_CHECK_AT_PREP` is macro and not a function it means line where the `PAGE_FLAGS_CHECK_AT_PREP` macro definition starts. For the last/differing macro in the call stack it is not possible to extract information about its definition from the call stack, but it can be extracted from `SyntaxDiff` in `ComparisonGraph` which includes info about the definition of differing macros from the call stacks (see PR diffkemp#333 for more info).
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.
First part of commits from #314 .
This PR adds:
macro,assembly,macro-function,function-macro) -- I think it could be useful to have this saved in Python, personally I used this information for visualisation offunction-macro/macro-functiondifferences in the result viewer, but right now I am thinking it is not absolutely necessary because I should be able to deduce this based on names of the differing 'objects', but I am still thinking it could be useful to have it.I will reference comments/questions from #314 which are relevant to this PR.