From 38bac73cd20f69b24375cc4e35c82cb8813eca03 Mon Sep 17 00:00:00 2001 From: Sim Sun Date: Thu, 12 May 2022 12:11:39 -0700 Subject: [PATCH] Remove unnecessary local map re-parsing for libunwindstack Reviewed By: aandreyeu Differential Revision: D36303754 fbshipit-source-id: 708d140cc3a6cff3149029840060206e4ea9a696 --- cpp/api/ExternalApiGlue.h | 1 + cpp/codegen/config/android.py | 1 + cpp/generated/EntryType.cpp | 3 ++- cpp/generated/EntryType.h | 3 ++- cpp/generated/EntryType.java | 4 +++- cpp/profiler/Retcode.cpp | 3 +++ 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cpp/api/ExternalApiGlue.h b/cpp/api/ExternalApiGlue.h index 153757b8..a39cde54 100644 --- a/cpp/api/ExternalApiGlue.h +++ b/cpp/api/ExternalApiGlue.h @@ -39,6 +39,7 @@ typedef enum { PARTIAL_STACK = 8, STACK_COPY_FAILED = 9, UNWINDER_QUEUE_OVERFLOW = 10, + INVALID_MAP = 11, MAXVAL, } StackCollectionRetcode; diff --git a/cpp/codegen/config/android.py b/cpp/codegen/config/android.py index d6d466be..6c777b5a 100644 --- a/cpp/codegen/config/android.py +++ b/cpp/codegen/config/android.py @@ -145,6 +145,7 @@ "WALL_STACK_SAMPLE", "MEMORY_MAPPING_FAILURE", "THREAD_NAMING", + "STKERR_INVALID_MAP", ] STACK_FRAME_ENTRIES = frozenset( diff --git a/cpp/generated/EntryType.cpp b/cpp/generated/EntryType.cpp index 01df88b0..b2c6a25e 100644 --- a/cpp/generated/EntryType.cpp +++ b/cpp/generated/EntryType.cpp @@ -1,4 +1,4 @@ -// @generated SignedSource<<0505a44b95e5066c7c5d35014e9b40b3>> +// @generated SignedSource<> #include #include @@ -127,6 +127,7 @@ const char* to_string(EntryType type) { case EntryType::WALL_STACK_SAMPLE: return "WALL_STACK_SAMPLE"; case EntryType::MEMORY_MAPPING_FAILURE: return "MEMORY_MAPPING_FAILURE"; case EntryType::THREAD_NAMING: return "THREAD_NAMING"; + case EntryType::STKERR_INVALID_MAP: return "STKERR_INVALID_MAP"; default: throw std::invalid_argument("Unknown entry type"); } } diff --git a/cpp/generated/EntryType.h b/cpp/generated/EntryType.h index 58492ddd..b34a67c6 100644 --- a/cpp/generated/EntryType.h +++ b/cpp/generated/EntryType.h @@ -1,4 +1,4 @@ -// @generated SignedSource<<7236a3f095a4bf72f4e8d2d9f6a53eca>> +// @generated SignedSource<<1959b2ffeb1868d427c23292272a02c5>> #pragma once @@ -124,6 +124,7 @@ enum class EntryType { WALL_STACK_SAMPLE = 115, MEMORY_MAPPING_FAILURE = 116, THREAD_NAMING = 117, + STKERR_INVALID_MAP = 118, }; diff --git a/cpp/generated/EntryType.java b/cpp/generated/EntryType.java index f5dce9ea..19cbc2a4 100644 --- a/cpp/generated/EntryType.java +++ b/cpp/generated/EntryType.java @@ -1,4 +1,4 @@ -// @generated SignedSource<<319fcc2ef82797d610083c835ff46a9d>> +// @generated SignedSource<> package com.facebook.profilo.entries; @@ -122,6 +122,7 @@ public class EntryType { public static final int WALL_STACK_SAMPLE = 115; public static final int MEMORY_MAPPING_FAILURE = 116; public static final int THREAD_NAMING = 117; + public static final int STKERR_INVALID_MAP = 118; public static final String[] NAMES = { "UNKNOWN_TYPE", @@ -242,5 +243,6 @@ public class EntryType { "WALL_STACK_SAMPLE", "MEMORY_MAPPING_FAILURE", "THREAD_NAMING", + "STKERR_INVALID_MAP", }; } diff --git a/cpp/profiler/Retcode.cpp b/cpp/profiler/Retcode.cpp index bd67e19e..eb741150 100644 --- a/cpp/profiler/Retcode.cpp +++ b/cpp/profiler/Retcode.cpp @@ -53,6 +53,9 @@ EntryType errorToTraceEntry(StackCollectionRetcode error) { case StackCollectionRetcode::PARTIAL_STACK: return EntryType::STKERR_PARTIALSTACK; + case StackCollectionRetcode::INVALID_MAP: + return EntryType::STKERR_INVALID_MAP; + case StackCollectionRetcode::TRACER_DISABLED: case StackCollectionRetcode::SUCCESS: case StackCollectionRetcode::IGNORE: