Skip to content
This repository has been archived by the owner on May 1, 2023. It is now read-only.

Commit

Permalink
Remove unnecessary local map re-parsing for libunwindstack
Browse files Browse the repository at this point in the history
Reviewed By: aandreyeu

Differential Revision: D36303754

fbshipit-source-id: 708d140cc3a6cff3149029840060206e4ea9a696
  • Loading branch information
simpleton authored and facebook-github-bot committed May 12, 2022
1 parent 599ced2 commit 38bac73
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions cpp/api/ExternalApiGlue.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ typedef enum {
PARTIAL_STACK = 8,
STACK_COPY_FAILED = 9,
UNWINDER_QUEUE_OVERFLOW = 10,
INVALID_MAP = 11,
MAXVAL,
} StackCollectionRetcode;

Expand Down
1 change: 1 addition & 0 deletions cpp/codegen/config/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"WALL_STACK_SAMPLE",
"MEMORY_MAPPING_FAILURE",
"THREAD_NAMING",
"STKERR_INVALID_MAP",
]

STACK_FRAME_ENTRIES = frozenset(
Expand Down
3 changes: 2 additions & 1 deletion cpp/generated/EntryType.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated SignedSource<<0505a44b95e5066c7c5d35014e9b40b3>>
// @generated SignedSource<<ddb15ac11ce4c74eb08b3ee312829017>>

#include <stdexcept>
#include <profilo/entries/EntryType.h>
Expand Down Expand Up @@ -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");
}
}
Expand Down
3 changes: 2 additions & 1 deletion cpp/generated/EntryType.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated SignedSource<<7236a3f095a4bf72f4e8d2d9f6a53eca>>
// @generated SignedSource<<1959b2ffeb1868d427c23292272a02c5>>

#pragma once

Expand Down Expand Up @@ -124,6 +124,7 @@ enum class EntryType {
WALL_STACK_SAMPLE = 115,
MEMORY_MAPPING_FAILURE = 116,
THREAD_NAMING = 117,
STKERR_INVALID_MAP = 118,
};


Expand Down
4 changes: 3 additions & 1 deletion cpp/generated/EntryType.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @generated SignedSource<<319fcc2ef82797d610083c835ff46a9d>>
// @generated SignedSource<<b59ea2208f5b4fdce3e6fcdb16da08a4>>

package com.facebook.profilo.entries;

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -242,5 +243,6 @@ public class EntryType {
"WALL_STACK_SAMPLE",
"MEMORY_MAPPING_FAILURE",
"THREAD_NAMING",
"STKERR_INVALID_MAP",
};
}
3 changes: 3 additions & 0 deletions cpp/profiler/Retcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 38bac73

Please sign in to comment.