Skip to content

Commit

Permalink
fixed include filters
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisSoemers committed Apr 7, 2023
1 parent d6a6c8c commit bc28772
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ message("Using toolchain file ${CMAKE_TOOLCHAIN_FILE}.")
########################################################################################################################
project(
PapyrusProfiler
VERSION 2.0.1
VERSION 2.0.2
DESCRIPTION "A profiler for Skyrim's Papyrus scripting language."
LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"Description": "This configuration collects all OnItemAdded/OnItemRemoved events. No stopping condition: should be stopped manually.",
"OutFilename": "OnItemAddedRemoved",
"MaxFilepathSuffix": 3,
"MaxNumCalls": 0,
"MaxNumSeconds": 0,
"WriteMode": 0,
"IncludeFilters": [
"^.*\\.OnItemAdded.*$",
"^.*\\.OnItemRemoved.*$"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"Description": "This configuration profiles for up to a million seconds, and writes in real-time.",
"OutFilename": "ProfileForeverWriteRealtime",
"MaxFilepathSuffix": 3,
"MaxNumSeconds": 1000000,
"NumSkipSeconds": 0,
"WriteMode": 1
}
4 changes: 2 additions & 2 deletions include/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//
// Instead, edit the template in /cmake/version.h.in

#define PROJECT_VER 2.0.1
#define PROJECT_VER 2.0.2
#define PROJECT_VER_MAJOR 2
#define PROJECT_VER_MINOR 0
#define PROJECT_VER_PATCH 1
#define PROJECT_VER_PATCH 2
14 changes: 10 additions & 4 deletions src/ProfilingHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,18 @@ static RE::BSFixedString* Profiling::FuncCallHook(
}

bool matchesFilters = true;
for (const std::regex& filter : profilingHook.activeConfig->includeFilters) {
if (!std::regex_match(stackTraceStr, filter)) {
matchesFilters = false;
break;

if (profilingHook.activeConfig->includeFilters.size() > 0) {
matchesFilters = false;

for (const std::regex& filter : profilingHook.activeConfig->includeFilters) {
if (std::regex_match(stackTraceStr, filter)) {
matchesFilters = true;
break;
}
}
}

if (matchesFilters) {
for (const std::regex& filter : profilingHook.activeConfig->excludeFilters) {
if (std::regex_match(stackTraceStr, filter)) {
Expand Down
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://raw.githubusercontent.com/microsoft/vcpkg/master/scripts/vcpkg.schema.json",
"name": "papyrus-profiler-plugin",
"version-string": "2.0.1",
"version-string": "2.0.2",
"port-version": 0,
"description": "A profiler for Skyrim's Papyrus scripting language.",
"license": "Apache-2.0",
Expand Down

0 comments on commit bc28772

Please sign in to comment.