Rename PERFETTO_EXPORT to PERFETTO_COMPONENT_EXPORT We already have different export macros, and a future CL is going to introduce a different one. This rename tries to make it clearer that the PERFETTO_EXPORT macro is only used for component builds. Change-Id: Iad322496afb4560f42f81dbb5662a48cd384dd91
diff --git a/docs/design-docs/api-and-abi.md b/docs/design-docs/api-and-abi.md index 283cdf5..8e6a639 100644 --- a/docs/design-docs/api-and-abi.md +++ b/docs/design-docs/api-and-abi.md
@@ -497,9 +497,10 @@ different linker unit. It is fine to link AND use the client library within the same shared library, as long as none of the perfetto C++ API is exported. -The `PERFETTO_EXPORT` annotations are only used when building the third tier of -the client library in chromium component builds and cannot be easily repurposed -for delineating shared library boundaries for the other two API tiers. +The `PERFETTO_COMPONENT_EXPORT` annotations are only used when building the +third tier of the client library in chromium component builds and cannot be +easily repurposed for delineating shared library boundaries for the other two +API tiers. This is because the C++ the first two tiers of the Client Library C++ API make extensive use of inline headers and C++ templates, in order to allow the
diff --git a/include/perfetto/base/export.h b/include/perfetto/base/export.h index 6904ada..4ebda82 100644 --- a/include/perfetto/base/export.h +++ b/include/perfetto/base/export.h
@@ -24,24 +24,24 @@ #if PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) #if defined(PERFETTO_IMPLEMENTATION) -#define PERFETTO_EXPORT __declspec(dllexport) +#define PERFETTO_COMPONENT_EXPORT __declspec(dllexport) #else -#define PERFETTO_EXPORT __declspec(dllimport) +#define PERFETTO_COMPONENT_EXPORT __declspec(dllimport) #endif #else // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) #if defined(PERFETTO_IMPLEMENTATION) -#define PERFETTO_EXPORT __attribute__((visibility("default"))) +#define PERFETTO_COMPONENT_EXPORT __attribute__((visibility("default"))) #else -#define PERFETTO_EXPORT +#define PERFETTO_COMPONENT_EXPORT #endif #endif // PERFETTO_BUILDFLAG(PERFETTO_OS_WIN) #else // !PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD) -#define PERFETTO_EXPORT +#define PERFETTO_COMPONENT_EXPORT #endif // PERFETTO_BUILDFLAG(PERFETTO_COMPONENT_BUILD)
diff --git a/include/perfetto/base/logging.h b/include/perfetto/base/logging.h index 3599dda..5ea2f1e 100644 --- a/include/perfetto/base/logging.h +++ b/include/perfetto/base/logging.h
@@ -114,18 +114,19 @@ // This is not thread safe and must be called before using tracing from other // threads. -PERFETTO_EXPORT void SetLogMessageCallback(LogMessageCallback callback); +PERFETTO_COMPONENT_EXPORT void SetLogMessageCallback( + LogMessageCallback callback); -PERFETTO_EXPORT void LogMessage(LogLev, - const char* fname, - int line, - const char* fmt, - ...) PERFETTO_PRINTF_FORMAT(4, 5); +PERFETTO_COMPONENT_EXPORT void LogMessage(LogLev, + const char* fname, + int line, + const char* fmt, + ...) PERFETTO_PRINTF_FORMAT(4, 5); // This is defined in debug_crash_stack_trace.cc, but that is only linked in // standalone && debug builds, see enable_perfetto_stderr_crash_dump in // perfetto.gni. -PERFETTO_EXPORT void EnableStacktraceOnCrashForDebug(); +PERFETTO_COMPONENT_EXPORT void EnableStacktraceOnCrashForDebug(); #if PERFETTO_ENABLE_LOG_RING_BUFFER() // Gets a snapshot of the logs from the internal log ring buffer and: @@ -134,7 +135,7 @@ // - On standalone builds (all otther OSes) prints that on stderr. // This function must called only once, right before inducing a crash (This is // because android_set_abort_message() can only be called once). -PERFETTO_EXPORT void MaybeSerializeLastLogsForCrashReporting(); +PERFETTO_COMPONENT_EXPORT void MaybeSerializeLastLogsForCrashReporting(); #else inline void MaybeSerializeLastLogsForCrashReporting() {} #endif
diff --git a/include/perfetto/base/status.h b/include/perfetto/base/status.h index c48d86a..a52c908 100644 --- a/include/perfetto/base/status.h +++ b/include/perfetto/base/status.h
@@ -30,7 +30,7 @@ // This can used as the return type of functions which would usually return an // bool for success or int for errno but also wants to add some string context // (ususally for logging). -class PERFETTO_EXPORT Status { +class PERFETTO_COMPONENT_EXPORT Status { public: Status() : ok_(true) {} explicit Status(std::string msg) : ok_(false), message_(std::move(msg)) {
diff --git a/include/perfetto/base/task_runner.h b/include/perfetto/base/task_runner.h index 4f64bf8..ea573dc 100644 --- a/include/perfetto/base/task_runner.h +++ b/include/perfetto/base/task_runner.h
@@ -37,7 +37,7 @@ // memory barrier between tasks. // // All methods of this interface can be called from any thread. -class PERFETTO_EXPORT TaskRunner { +class PERFETTO_COMPONENT_EXPORT TaskRunner { public: virtual ~TaskRunner();
diff --git a/include/perfetto/ext/base/file_utils.h b/include/perfetto/ext/base/file_utils.h index 5920196..2c1b205 100644 --- a/include/perfetto/ext/base/file_utils.h +++ b/include/perfetto/ext/base/file_utils.h
@@ -68,7 +68,7 @@ // This is an alias for close(). It's to avoid leaking Windows.h in headers. // Exported because ScopedFile is used in the /include/ext API by Chromium // component builds. -int PERFETTO_EXPORT CloseFile(int fd); +int PERFETTO_COMPONENT_EXPORT CloseFile(int fd); bool FlushFile(int fd);
diff --git a/include/perfetto/ext/base/scoped_file.h b/include/perfetto/ext/base/scoped_file.h index 53d21b1..e6a6166 100644 --- a/include/perfetto/ext/base/scoped_file.h +++ b/include/perfetto/ext/base/scoped_file.h
@@ -91,7 +91,7 @@ }; // Declared in file_utils.h. Forward declared to avoid #include cycles. -int PERFETTO_EXPORT CloseFile(int fd); +int PERFETTO_COMPONENT_EXPORT CloseFile(int fd); // Use this for file resources obtained via open() and similar APIs. using ScopedFile = ScopedResource<int, CloseFile, -1>;
diff --git a/include/perfetto/ext/base/thread_checker.h b/include/perfetto/ext/base/thread_checker.h index 2b341b5..aa6fb33 100644 --- a/include/perfetto/ext/base/thread_checker.h +++ b/include/perfetto/ext/base/thread_checker.h
@@ -37,7 +37,7 @@ using ThreadID = pthread_t; #endif -class PERFETTO_EXPORT ThreadChecker { +class PERFETTO_COMPONENT_EXPORT ThreadChecker { public: ThreadChecker(); ~ThreadChecker();
diff --git a/include/perfetto/ext/base/thread_task_runner.h b/include/perfetto/ext/base/thread_task_runner.h index 5f5947e..1d8cdf9 100644 --- a/include/perfetto/ext/base/thread_task_runner.h +++ b/include/perfetto/ext/base/thread_task_runner.h
@@ -32,7 +32,7 @@ // * the UnixTaskRunner will be constructed and destructed on the task thread. // * the task thread will live for the lifetime of the UnixTaskRunner. // -class PERFETTO_EXPORT ThreadTaskRunner : public TaskRunner { +class PERFETTO_COMPONENT_EXPORT ThreadTaskRunner : public TaskRunner { public: static ThreadTaskRunner CreateAndStart(const std::string& name = "") { return ThreadTaskRunner(name);
diff --git a/include/perfetto/ext/base/unix_socket.h b/include/perfetto/ext/base/unix_socket.h index a769423..2415cec 100644 --- a/include/perfetto/ext/base/unix_socket.h +++ b/include/perfetto/ext/base/unix_socket.h
@@ -217,7 +217,7 @@ // | (failure or Shutdown()) // V // OnDisconnect() -class PERFETTO_EXPORT UnixSocket { +class PERFETTO_COMPONENT_EXPORT UnixSocket { public: class EventListener { public:
diff --git a/include/perfetto/ext/ipc/service_proxy.h b/include/perfetto/ext/ipc/service_proxy.h index 02c2dc2..8e53121 100644 --- a/include/perfetto/ext/ipc/service_proxy.h +++ b/include/perfetto/ext/ipc/service_proxy.h
@@ -39,7 +39,7 @@ // The base class for the client-side autogenerated stubs that forward method // invocations to the host. All the methods of this class are meant to be called // only by the autogenerated code. -class PERFETTO_EXPORT ServiceProxy { +class PERFETTO_COMPONENT_EXPORT ServiceProxy { public: class EventListener { public:
diff --git a/include/perfetto/ext/trace_processor/export_json.h b/include/perfetto/ext/trace_processor/export_json.h index d5c5dac..3850e62 100644 --- a/include/perfetto/ext/trace_processor/export_json.h +++ b/include/perfetto/ext/trace_processor/export_json.h
@@ -39,7 +39,7 @@ using MetadataFilterPredicate = std::function<bool(const char* metadata_name)>; using LabelFilterPredicate = std::function<bool(const char* label_name)>; -class PERFETTO_EXPORT OutputWriter { +class PERFETTO_COMPONENT_EXPORT OutputWriter { public: OutputWriter(); virtual ~OutputWriter(); @@ -49,11 +49,12 @@ // Public for Chrome. Exports the trace loaded in TraceProcessorStorage to json, // applying argument, metadata and label filtering using the callbacks. -util::Status PERFETTO_EXPORT ExportJson(TraceProcessorStorage*, - OutputWriter*, - ArgumentFilterPredicate = nullptr, - MetadataFilterPredicate = nullptr, - LabelFilterPredicate = nullptr); +util::Status PERFETTO_COMPONENT_EXPORT +ExportJson(TraceProcessorStorage*, + OutputWriter*, + ArgumentFilterPredicate = nullptr, + MetadataFilterPredicate = nullptr, + LabelFilterPredicate = nullptr); } // namespace json } // namespace trace_processor
diff --git a/include/perfetto/ext/trace_processor/importers/memory_tracker/graph.h b/include/perfetto/ext/trace_processor/importers/memory_tracker/graph.h index d8a9d87..ac1c436 100644 --- a/include/perfetto/ext/trace_processor/importers/memory_tracker/graph.h +++ b/include/perfetto/ext/trace_processor/importers/memory_tracker/graph.h
@@ -38,7 +38,7 @@ // Contains processed node graphs for each process and in the global space. // This class is also the arena which owns the nodes of the graph. -class PERFETTO_EXPORT GlobalNodeGraph { +class PERFETTO_COMPONENT_EXPORT GlobalNodeGraph { public: class Node; class Edge; @@ -47,7 +47,7 @@ // Graph of nodes either associated with a process or with // the shared space. - class PERFETTO_EXPORT Process { + class PERFETTO_COMPONENT_EXPORT Process { public: Process(base::PlatformProcessId pid, GlobalNodeGraph* global_graph); ~Process(); @@ -76,11 +76,11 @@ // A single node in the graph of allocator nodes associated with a // certain path and containing the entries for this path. - class PERFETTO_EXPORT Node { + class PERFETTO_COMPONENT_EXPORT Node { public: // Auxilary data (a scalar number or a string) about this node each // associated with a key. - struct PERFETTO_EXPORT Entry { + struct PERFETTO_COMPONENT_EXPORT Entry { enum Type { kUInt64, kString, @@ -212,7 +212,7 @@ // An edge in the node graph which indicates ownership between the // source and target nodes. - class PERFETTO_EXPORT Edge { + class PERFETTO_COMPONENT_EXPORT Edge { public: Edge(GlobalNodeGraph::Node* source, GlobalNodeGraph::Node* target, @@ -229,7 +229,7 @@ }; // An iterator-esque class which yields nodes in a depth-first pre order. - class PERFETTO_EXPORT PreOrderIterator { + class PERFETTO_COMPONENT_EXPORT PreOrderIterator { public: explicit PreOrderIterator(std::vector<Node*>&& root_nodes); PreOrderIterator(PreOrderIterator&& other); @@ -244,7 +244,7 @@ }; // An iterator-esque class which yields nodes in a depth-first post order. - class PERFETTO_EXPORT PostOrderIterator { + class PERFETTO_COMPONENT_EXPORT PostOrderIterator { public: explicit PostOrderIterator(std::vector<Node*>&& root_nodes); PostOrderIterator(PostOrderIterator&& other);
diff --git a/include/perfetto/ext/trace_processor/importers/memory_tracker/graph_processor.h b/include/perfetto/ext/trace_processor/importers/memory_tracker/graph_processor.h index c9fea6b..6d0d790 100644 --- a/include/perfetto/ext/trace_processor/importers/memory_tracker/graph_processor.h +++ b/include/perfetto/ext/trace_processor/importers/memory_tracker/graph_processor.h
@@ -31,7 +31,7 @@ namespace perfetto { namespace trace_processor { -class PERFETTO_EXPORT GraphProcessor { +class PERFETTO_COMPONENT_EXPORT GraphProcessor { public: // This map does not own the pointers inside. using RawMemoryNodeMap =
diff --git a/include/perfetto/ext/trace_processor/importers/memory_tracker/memory_allocator_node_id.h b/include/perfetto/ext/trace_processor/importers/memory_tracker/memory_allocator_node_id.h index f4899d5..d16a1d4 100644 --- a/include/perfetto/ext/trace_processor/importers/memory_tracker/memory_allocator_node_id.h +++ b/include/perfetto/ext/trace_processor/importers/memory_tracker/memory_allocator_node_id.h
@@ -26,7 +26,7 @@ namespace perfetto { namespace trace_processor { -class PERFETTO_EXPORT MemoryAllocatorNodeId { +class PERFETTO_COMPONENT_EXPORT MemoryAllocatorNodeId { public: MemoryAllocatorNodeId(); explicit MemoryAllocatorNodeId(uint64_t id);
diff --git a/include/perfetto/ext/trace_processor/importers/memory_tracker/memory_graph_edge.h b/include/perfetto/ext/trace_processor/importers/memory_tracker/memory_graph_edge.h index 6f7d4fe..b6d2c02 100644 --- a/include/perfetto/ext/trace_processor/importers/memory_tracker/memory_graph_edge.h +++ b/include/perfetto/ext/trace_processor/importers/memory_tracker/memory_graph_edge.h
@@ -25,7 +25,7 @@ namespace perfetto { namespace trace_processor { -class PERFETTO_EXPORT MemoryGraphEdge { +class PERFETTO_COMPONENT_EXPORT MemoryGraphEdge { public: MemoryGraphEdge(MemoryAllocatorNodeId s, MemoryAllocatorNodeId t,
diff --git a/include/perfetto/ext/trace_processor/importers/memory_tracker/raw_memory_graph_node.h b/include/perfetto/ext/trace_processor/importers/memory_tracker/raw_memory_graph_node.h index e865afe..e7c6f0c 100644 --- a/include/perfetto/ext/trace_processor/importers/memory_tracker/raw_memory_graph_node.h +++ b/include/perfetto/ext/trace_processor/importers/memory_tracker/raw_memory_graph_node.h
@@ -54,7 +54,7 @@ }; // Data model for user-land memory nodes. -class PERFETTO_EXPORT RawMemoryGraphNode { +class PERFETTO_COMPONENT_EXPORT RawMemoryGraphNode { public: enum Flags { kDefault = 0, @@ -67,7 +67,7 @@ // In the UI table each MemoryAllocatorNode becomes // a row and each Entry generates a column (if it doesn't already // exist). - struct PERFETTO_EXPORT MemoryNodeEntry { + struct PERFETTO_COMPONENT_EXPORT MemoryNodeEntry { enum EntryType { kUint64, kString,
diff --git a/include/perfetto/ext/trace_processor/importers/memory_tracker/raw_process_memory_node.h b/include/perfetto/ext/trace_processor/importers/memory_tracker/raw_process_memory_node.h index 66b4e89..93f8b36 100644 --- a/include/perfetto/ext/trace_processor/importers/memory_tracker/raw_process_memory_node.h +++ b/include/perfetto/ext/trace_processor/importers/memory_tracker/raw_process_memory_node.h
@@ -34,7 +34,7 @@ // ProcessMemoryNode is as a strongly typed container which holds the nodes // produced by the MemoryNodeProvider(s) for a specific process. -class PERFETTO_EXPORT RawProcessMemoryNode { +class PERFETTO_COMPONENT_EXPORT RawProcessMemoryNode { public: // Maps allocator nodes absolute names (allocator_name/heap/subheap) to // MemoryAllocatorNode instances.
diff --git a/include/perfetto/ext/tracing/core/consumer.h b/include/perfetto/ext/tracing/core/consumer.h index fce7c65..cca1b86 100644 --- a/include/perfetto/ext/tracing/core/consumer.h +++ b/include/perfetto/ext/tracing/core/consumer.h
@@ -27,7 +27,7 @@ class TracePacket; -class PERFETTO_EXPORT Consumer { +class PERFETTO_COMPONENT_EXPORT Consumer { public: virtual ~Consumer();
diff --git a/include/perfetto/ext/tracing/core/producer.h b/include/perfetto/ext/tracing/core/producer.h index 5c45d8f..ae95d7a 100644 --- a/include/perfetto/ext/tracing/core/producer.h +++ b/include/perfetto/ext/tracing/core/producer.h
@@ -41,7 +41,7 @@ // This interface is subclassed by: // 1. The actual producer code in the clients e.g., the ftrace reader process. // 2. The transport layer when interposing RPC between service and producers. -class PERFETTO_EXPORT Producer { +class PERFETTO_COMPONENT_EXPORT Producer { public: virtual ~Producer();
diff --git a/include/perfetto/ext/tracing/core/shared_memory.h b/include/perfetto/ext/tracing/core/shared_memory.h index b1bcbcb..c973d93 100644 --- a/include/perfetto/ext/tracing/core/shared_memory.h +++ b/include/perfetto/ext/tracing/core/shared_memory.h
@@ -33,9 +33,9 @@ // memory for the out-of-process case (see src/unix_rpc). // Both this class and the Factory are subclassed by the transport layer, which // will attach platform specific fields to it (e.g., a unix file descriptor). -class PERFETTO_EXPORT SharedMemory { +class PERFETTO_COMPONENT_EXPORT SharedMemory { public: - class PERFETTO_EXPORT Factory { + class PERFETTO_COMPONENT_EXPORT Factory { public: virtual ~Factory(); virtual std::unique_ptr<SharedMemory> CreateSharedMemory(size_t) = 0;
diff --git a/include/perfetto/ext/tracing/core/shared_memory_arbiter.h b/include/perfetto/ext/tracing/core/shared_memory_arbiter.h index 8d371a3..17f8d3d 100644 --- a/include/perfetto/ext/tracing/core/shared_memory_arbiter.h +++ b/include/perfetto/ext/tracing/core/shared_memory_arbiter.h
@@ -39,7 +39,7 @@ // Used by the Producer-side of the transport layer to vend TraceWriters // from the SharedMemory it receives from the Service-side. -class PERFETTO_EXPORT SharedMemoryArbiter { +class PERFETTO_COMPONENT_EXPORT SharedMemoryArbiter { public: virtual ~SharedMemoryArbiter();
diff --git a/include/perfetto/ext/tracing/core/trace_packet.h b/include/perfetto/ext/tracing/core/trace_packet.h index c1e7948..5fa96e1 100644 --- a/include/perfetto/ext/tracing/core/trace_packet.h +++ b/include/perfetto/ext/tracing/core/trace_packet.h
@@ -35,7 +35,7 @@ // If the packets are saved / streamed and not just consumed locally, consumers // should ensure to preserve the unknown fields in the proto. A consumer, in // fact, might have an older version .proto which is newer on the producer. -class PERFETTO_EXPORT TracePacket { +class PERFETTO_COMPONENT_EXPORT TracePacket { public: using const_iterator = Slices::const_iterator;
diff --git a/include/perfetto/ext/tracing/core/trace_writer.h b/include/perfetto/ext/tracing/core/trace_writer.h index f5e5eee..4512380 100644 --- a/include/perfetto/ext/tracing/core/trace_writer.h +++ b/include/perfetto/ext/tracing/core/trace_writer.h
@@ -33,7 +33,7 @@ } // namespace protos // See comments in include/perfetto/tracing/trace_writer_base.h -class PERFETTO_EXPORT TraceWriter : public TraceWriterBase { +class PERFETTO_COMPONENT_EXPORT TraceWriter : public TraceWriterBase { public: using TracePacketHandle = protozero::MessageHandle<protos::pbzero::TracePacket>;
diff --git a/include/perfetto/ext/tracing/core/tracing_service.h b/include/perfetto/ext/tracing/core/tracing_service.h index 49c070c..c28e97c 100644 --- a/include/perfetto/ext/tracing/core/tracing_service.h +++ b/include/perfetto/ext/tracing/core/tracing_service.h
@@ -54,7 +54,7 @@ // to the ConnectProducer() method. // 2. The transport layer (e.g., src/ipc) when the producer and // the service don't talk locally but via some IPC mechanism. -class PERFETTO_EXPORT ProducerEndpoint { +class PERFETTO_COMPONENT_EXPORT ProducerEndpoint { public: virtual ~ProducerEndpoint(); @@ -156,7 +156,7 @@ // the ConnectConsumer() method. // 2. The transport layer (e.g., src/ipc) when the consumer and // the service don't talk locally but via some IPC mechanism. -class PERFETTO_EXPORT ConsumerEndpoint { +class PERFETTO_COMPONENT_EXPORT ConsumerEndpoint { public: virtual ~ConsumerEndpoint(); @@ -253,7 +253,7 @@ // // Subclassed by: // The service business logic in src/core/tracing_service_impl.cc. -class PERFETTO_EXPORT TracingService { +class PERFETTO_COMPONENT_EXPORT TracingService { public: using ProducerEndpoint = perfetto::ProducerEndpoint; using ConsumerEndpoint = perfetto::ConsumerEndpoint;
diff --git a/include/perfetto/ext/tracing/ipc/consumer_ipc_client.h b/include/perfetto/ext/tracing/ipc/consumer_ipc_client.h index bb88073..3516737 100644 --- a/include/perfetto/ext/tracing/ipc/consumer_ipc_client.h +++ b/include/perfetto/ext/tracing/ipc/consumer_ipc_client.h
@@ -32,7 +32,7 @@ // Consumer(s) of the tracing library. // Implemented in: // src/tracing/ipc/consumer/consumer_ipc_client_impl.cc -class PERFETTO_EXPORT ConsumerIPCClient { +class PERFETTO_COMPONENT_EXPORT ConsumerIPCClient { public: // Connects to the producer port of the Service listening on the given // |service_sock_name|. If the connection is successful, the OnConnect()
diff --git a/include/perfetto/ext/tracing/ipc/default_socket.h b/include/perfetto/ext/tracing/ipc/default_socket.h index 6f1fafb..6af12e0 100644 --- a/include/perfetto/ext/tracing/ipc/default_socket.h +++ b/include/perfetto/ext/tracing/ipc/default_socket.h
@@ -21,8 +21,8 @@ namespace perfetto { -PERFETTO_EXPORT const char* GetConsumerSocket(); -PERFETTO_EXPORT const char* GetProducerSocket(); +PERFETTO_COMPONENT_EXPORT const char* GetConsumerSocket(); +PERFETTO_COMPONENT_EXPORT const char* GetProducerSocket(); } // namespace perfetto
diff --git a/include/perfetto/ext/tracing/ipc/producer_ipc_client.h b/include/perfetto/ext/tracing/ipc/producer_ipc_client.h index da496b9..2dfa3e1 100644 --- a/include/perfetto/ext/tracing/ipc/producer_ipc_client.h +++ b/include/perfetto/ext/tracing/ipc/producer_ipc_client.h
@@ -35,7 +35,7 @@ // Producer(s) of the tracing library. // Implemented in: // src/tracing/ipc/producer/producer_ipc_client_impl.cc -class PERFETTO_EXPORT ProducerIPCClient { +class PERFETTO_COMPONENT_EXPORT ProducerIPCClient { public: enum class ConnectionFlags { // Fails immediately with OnConnect(false) if the service connection cannot
diff --git a/include/perfetto/ext/tracing/ipc/service_ipc_host.h b/include/perfetto/ext/tracing/ipc/service_ipc_host.h index 567851d..3815dad 100644 --- a/include/perfetto/ext/tracing/ipc/service_ipc_host.h +++ b/include/perfetto/ext/tracing/ipc/service_ipc_host.h
@@ -36,7 +36,7 @@ // The code in the tracing client that will host the service e.g., traced. // Implemented in: // src/tracing/ipc/service/service_ipc_host_impl.cc -class PERFETTO_EXPORT ServiceIPCHost { +class PERFETTO_COMPONENT_EXPORT ServiceIPCHost { public: static std::unique_ptr<ServiceIPCHost> CreateInstance(base::TaskRunner*); virtual ~ServiceIPCHost();
diff --git a/include/perfetto/protozero/cpp_message_obj.h b/include/perfetto/protozero/cpp_message_obj.h index 5af080f..84a32ce 100644 --- a/include/perfetto/protozero/cpp_message_obj.h +++ b/include/perfetto/protozero/cpp_message_obj.h
@@ -29,7 +29,7 @@ // Base class for generated .gen.h classes, which are full C++ objects that // support both ser and deserialization (but are not zero-copy). // This is only used by the "cpp" targets not the "pbzero" ones. -class PERFETTO_EXPORT CppMessageObj { +class PERFETTO_COMPONENT_EXPORT CppMessageObj { public: virtual ~CppMessageObj(); virtual std::string SerializeAsString() const = 0;
diff --git a/include/perfetto/protozero/message.h b/include/perfetto/protozero/message.h index 6a44ecc..e34b93b 100644 --- a/include/perfetto/protozero/message.h +++ b/include/perfetto/protozero/message.h
@@ -46,7 +46,7 @@ // append-only operations and is designed for performance. None of the methods // require any dynamic memory allocation, unless more than 16 nested messages // are created via BeginNestedMessage() calls. -class PERFETTO_EXPORT Message { +class PERFETTO_COMPONENT_EXPORT Message { public: friend class MessageHandleBase;
diff --git a/include/perfetto/protozero/message_arena.h b/include/perfetto/protozero/message_arena.h index 4905dae..18dce54 100644 --- a/include/perfetto/protozero/message_arena.h +++ b/include/perfetto/protozero/message_arena.h
@@ -37,7 +37,7 @@ // allocating new blocks only when using deeply nested messages (which are // extremely rare). // This is used by RootMessage<T> to handle the storage for root-level messages. -class PERFETTO_EXPORT MessageArena { +class PERFETTO_COMPONENT_EXPORT MessageArena { public: MessageArena(); ~MessageArena();
diff --git a/include/perfetto/protozero/message_handle.h b/include/perfetto/protozero/message_handle.h index 8ffb092..6198d4a 100644 --- a/include/perfetto/protozero/message_handle.h +++ b/include/perfetto/protozero/message_handle.h
@@ -37,7 +37,7 @@ // Think about this as a WeakPtr<Message> which calls // Message::Finalize() when going out of scope. -class PERFETTO_EXPORT MessageHandleBase { +class PERFETTO_COMPONENT_EXPORT MessageHandleBase { public: ~MessageHandleBase();
diff --git a/include/perfetto/protozero/proto_decoder.h b/include/perfetto/protozero/proto_decoder.h index c8e46dd..a6da6d4 100644 --- a/include/perfetto/protozero/proto_decoder.h +++ b/include/perfetto/protozero/proto_decoder.h
@@ -40,7 +40,7 @@ // (see proto_decoder_fuzzer.cc). // This class serves also as a building block for TypedProtoDecoder, used when // the schema is known at compile time. -class PERFETTO_EXPORT ProtoDecoder { +class PERFETTO_COMPONENT_EXPORT ProtoDecoder { public: // Creates a ProtoDecoder using the given |buffer| with size |length| bytes. ProtoDecoder(const void* buffer, size_t length) @@ -279,7 +279,7 @@ // num_fields_ size_ // Note that if a message has high field numbers, upon creation |size_| can be // < |num_fields_| (until a heap expansion is hit while inserting). -class PERFETTO_EXPORT TypedProtoDecoderBase : public ProtoDecoder { +class PERFETTO_COMPONENT_EXPORT TypedProtoDecoderBase : public ProtoDecoder { public: // If the field |id| is known at compile time, prefer the templated // specialization at<kFieldNumber>().
diff --git a/include/perfetto/protozero/scattered_heap_buffer.h b/include/perfetto/protozero/scattered_heap_buffer.h index d62612e..138abda 100644 --- a/include/perfetto/protozero/scattered_heap_buffer.h +++ b/include/perfetto/protozero/scattered_heap_buffer.h
@@ -30,10 +30,10 @@ class Message; -class PERFETTO_EXPORT ScatteredHeapBuffer +class PERFETTO_COMPONENT_EXPORT ScatteredHeapBuffer : public protozero::ScatteredStreamWriter::Delegate { public: - class PERFETTO_EXPORT Slice { + class PERFETTO_COMPONENT_EXPORT Slice { public: Slice(); explicit Slice(size_t size);
diff --git a/include/perfetto/protozero/scattered_stream_null_delegate.h b/include/perfetto/protozero/scattered_stream_null_delegate.h index 39d64f2..af116a3 100644 --- a/include/perfetto/protozero/scattered_stream_null_delegate.h +++ b/include/perfetto/protozero/scattered_stream_null_delegate.h
@@ -27,7 +27,7 @@ namespace protozero { -class PERFETTO_EXPORT ScatteredStreamWriterNullDelegate +class PERFETTO_COMPONENT_EXPORT ScatteredStreamWriterNullDelegate : public ScatteredStreamWriter::Delegate { public: explicit ScatteredStreamWriterNullDelegate(size_t chunk_size);
diff --git a/include/perfetto/protozero/scattered_stream_writer.h b/include/perfetto/protozero/scattered_stream_writer.h index c508ad9..0781b50 100644 --- a/include/perfetto/protozero/scattered_stream_writer.h +++ b/include/perfetto/protozero/scattered_stream_writer.h
@@ -41,9 +41,9 @@ // The purpose of this class is to abstract away the non-contiguous write logic. // This class knows how to deal with writes as long as they fall in the same // ContiguousMemoryRange and defers the chunk-chaining logic to the Delegate. -class PERFETTO_EXPORT ScatteredStreamWriter { +class PERFETTO_COMPONENT_EXPORT ScatteredStreamWriter { public: - class PERFETTO_EXPORT Delegate { + class PERFETTO_COMPONENT_EXPORT Delegate { public: virtual ~Delegate(); virtual ContiguousMemoryRange GetNewBuffer() = 0;
diff --git a/include/perfetto/protozero/static_buffer.h b/include/perfetto/protozero/static_buffer.h index 3d7ec3d..b32be9c 100644 --- a/include/perfetto/protozero/static_buffer.h +++ b/include/perfetto/protozero/static_buffer.h
@@ -32,7 +32,7 @@ // A simple implementation of ScatteredStreamWriter::Delegate backed by a // fixed-size buffer. It doesn't support expansion. The caller needs to ensure // to never write more than the size of the buffer. Will CHECK() otherwise. -class PERFETTO_EXPORT StaticBufferDelegate +class PERFETTO_COMPONENT_EXPORT StaticBufferDelegate : public ScatteredStreamWriter::Delegate { public: StaticBufferDelegate(uint8_t* buf, size_t len) : range_{buf, buf + len} {}
diff --git a/include/perfetto/test/traced_value_test_support.h b/include/perfetto/test/traced_value_test_support.h index 4fa0e2d..b5b7a0d 100644 --- a/include/perfetto/test/traced_value_test_support.h +++ b/include/perfetto/test/traced_value_test_support.h
@@ -25,7 +25,7 @@ namespace perfetto { namespace internal { -PERFETTO_EXPORT std::string DebugAnnotationToString( +PERFETTO_COMPONENT_EXPORT std::string DebugAnnotationToString( const std::string& proto_message); } // namespace internal
diff --git a/include/perfetto/trace_processor/basic_types.h b/include/perfetto/trace_processor/basic_types.h index e417779..e50d82f 100644 --- a/include/perfetto/trace_processor/basic_types.h +++ b/include/perfetto/trace_processor/basic_types.h
@@ -95,7 +95,7 @@ }; // Struct for configuring a TraceProcessor instance (see trace_processor.h). -struct PERFETTO_EXPORT Config { +struct PERFETTO_COMPONENT_EXPORT Config { // Indicates the sortinng mode that trace processor should use on the passed // trace packets. See the enum documentation for more details. SortingMode sorting_mode = SortingMode::kDefaultHeuristics; @@ -121,7 +121,7 @@ }; // Represents a dynamically typed value returned by SQL. -struct PERFETTO_EXPORT SqlValue { +struct PERFETTO_COMPONENT_EXPORT SqlValue { // Represents the type of the value. enum Type { kNull = 0,
diff --git a/include/perfetto/trace_processor/iterator.h b/include/perfetto/trace_processor/iterator.h index 95aa4c5..bb0eaef 100644 --- a/include/perfetto/trace_processor/iterator.h +++ b/include/perfetto/trace_processor/iterator.h
@@ -40,7 +40,7 @@ // } // printf("\n"); // } -class PERFETTO_EXPORT Iterator { +class PERFETTO_COMPONENT_EXPORT Iterator { public: explicit Iterator(std::unique_ptr<IteratorImpl>); ~Iterator();
diff --git a/include/perfetto/trace_processor/read_trace.h b/include/perfetto/trace_processor/read_trace.h index 3431e7d..8fa45c3 100644 --- a/include/perfetto/trace_processor/read_trace.h +++ b/include/perfetto/trace_processor/read_trace.h
@@ -28,14 +28,13 @@ class TraceProcessor; -util::Status PERFETTO_EXPORT ReadTrace( +util::Status PERFETTO_COMPONENT_EXPORT ReadTrace( TraceProcessor* tp, const char* filename, const std::function<void(uint64_t parsed_size)>& progress_callback = {}); -util::Status PERFETTO_EXPORT DecompressTrace(const uint8_t* data, - size_t size, - std::vector<uint8_t>* output); +util::Status PERFETTO_COMPONENT_EXPORT +DecompressTrace(const uint8_t* data, size_t size, std::vector<uint8_t>* output); } // namespace trace_processor } // namespace perfetto
diff --git a/include/perfetto/trace_processor/trace_blob.h b/include/perfetto/trace_processor/trace_blob.h index 108bb7a..8985ff4 100644 --- a/include/perfetto/trace_processor/trace_blob.h +++ b/include/perfetto/trace_processor/trace_blob.h
@@ -53,7 +53,7 @@ // sub-offsets of) the same TraceBlob. // The neat thing about TraceBlob is that it deals transparently with owned // memory (in the case of Allocate and TakeOwnership) and memory-mapped memory. -class PERFETTO_EXPORT TraceBlob : public RefCounted { +class PERFETTO_COMPONENT_EXPORT TraceBlob : public RefCounted { public: static TraceBlob Allocate(size_t size); static TraceBlob CopyFrom(const void*, size_t size);
diff --git a/include/perfetto/trace_processor/trace_processor.h b/include/perfetto/trace_processor/trace_processor.h index 972761d..3cc419a 100644 --- a/include/perfetto/trace_processor/trace_processor.h +++ b/include/perfetto/trace_processor/trace_processor.h
@@ -32,7 +32,7 @@ // Extends TraceProcessorStorage to support execution of SQL queries on loaded // traces. See TraceProcessorStorage for parsing of trace files. -class PERFETTO_EXPORT TraceProcessor : public TraceProcessorStorage { +class PERFETTO_COMPONENT_EXPORT TraceProcessor : public TraceProcessorStorage { public: // For legacy API clients. Iterator used to be a nested class here. Many API // clients depends on it at this point. @@ -127,7 +127,7 @@ }; // When set, logs SQLite actions on the console. -void PERFETTO_EXPORT EnableSQLiteVtableDebugging(); +void PERFETTO_COMPONENT_EXPORT EnableSQLiteVtableDebugging(); } // namespace trace_processor } // namespace perfetto
diff --git a/include/perfetto/trace_processor/trace_processor_storage.h b/include/perfetto/trace_processor/trace_processor_storage.h index 82a55d0..fef7a81 100644 --- a/include/perfetto/trace_processor/trace_processor_storage.h +++ b/include/perfetto/trace_processor/trace_processor_storage.h
@@ -31,7 +31,7 @@ namespace trace_processor { // Coordinates the loading of traces from an arbitrary source. -class PERFETTO_EXPORT TraceProcessorStorage { +class PERFETTO_COMPONENT_EXPORT TraceProcessorStorage { public: // Creates a new instance of TraceProcessorStorage. static std::unique_ptr<TraceProcessorStorage> CreateInstance(const Config&);
diff --git a/include/perfetto/tracing/console_interceptor.h b/include/perfetto/tracing/console_interceptor.h index 98c8879..53174c4 100644 --- a/include/perfetto/tracing/console_interceptor.h +++ b/include/perfetto/tracing/console_interceptor.h
@@ -57,7 +57,7 @@ struct ConsoleColor; -class PERFETTO_EXPORT ConsoleInterceptor +class PERFETTO_COMPONENT_EXPORT ConsoleInterceptor : public Interceptor<ConsoleInterceptor> { public: ~ConsoleInterceptor() override;
diff --git a/include/perfetto/tracing/data_source.h b/include/perfetto/tracing/data_source.h index 020708a..d8776c7 100644 --- a/include/perfetto/tracing/data_source.h +++ b/include/perfetto/tracing/data_source.h
@@ -64,7 +64,7 @@ // Base class with the virtual methods to get start/stop notifications. // Embedders are supposed to derive the templated version below, not this one. -class PERFETTO_EXPORT DataSourceBase { +class PERFETTO_COMPONENT_EXPORT DataSourceBase { public: virtual ~DataSourceBase();
diff --git a/include/perfetto/tracing/debug_annotation.h b/include/perfetto/tracing/debug_annotation.h index 86494cf..a5c370c 100644 --- a/include/perfetto/tracing/debug_annotation.h +++ b/include/perfetto/tracing/debug_annotation.h
@@ -48,7 +48,7 @@ } // namespace protos // A base class for custom track event debug annotations. -class PERFETTO_EXPORT DebugAnnotation { +class PERFETTO_COMPONENT_EXPORT DebugAnnotation { public: DebugAnnotation() = default; virtual ~DebugAnnotation();
diff --git a/include/perfetto/tracing/event_context.h b/include/perfetto/tracing/event_context.h index 02120bd..eac5aa4 100644 --- a/include/perfetto/tracing/event_context.h +++ b/include/perfetto/tracing/event_context.h
@@ -43,7 +43,7 @@ // ctx.AddDebugAnnotation("name", 1234); // }); // -class PERFETTO_EXPORT EventContext { +class PERFETTO_COMPONENT_EXPORT EventContext { public: EventContext(EventContext&&) = default;
diff --git a/include/perfetto/tracing/interceptor.h b/include/perfetto/tracing/interceptor.h index 91f4155..9cbc183 100644 --- a/include/perfetto/tracing/interceptor.h +++ b/include/perfetto/tracing/interceptor.h
@@ -179,7 +179,7 @@ // A virtual base class for interceptors. Users should derive from the templated // subclass below instead of this one. -class PERFETTO_EXPORT InterceptorBase { +class PERFETTO_COMPONENT_EXPORT InterceptorBase { public: virtual ~InterceptorBase(); @@ -246,7 +246,7 @@ // Templated interceptor instantiation. See above for usage. template <class InterceptorType> -class PERFETTO_EXPORT Interceptor : public InterceptorBase { +class PERFETTO_COMPONENT_EXPORT Interceptor : public InterceptorBase { public: // A context object provided to the ThreadLocalState constructor. Provides // access to the per-instance interceptor object.
diff --git a/include/perfetto/tracing/internal/checked_scope.h b/include/perfetto/tracing/internal/checked_scope.h index 29dfcd8..21a779c 100644 --- a/include/perfetto/tracing/internal/checked_scope.h +++ b/include/perfetto/tracing/internal/checked_scope.h
@@ -31,7 +31,7 @@ // being active and the inner scope becomes active instead. // - Only an active scope can be destroyed. When this happens, its parent scope // becomes active. -class PERFETTO_EXPORT CheckedScope { +class PERFETTO_COMPONENT_EXPORT CheckedScope { public: explicit CheckedScope(CheckedScope* parent_scope); ~CheckedScope();
diff --git a/include/perfetto/tracing/internal/in_process_tracing_backend.h b/include/perfetto/tracing/internal/in_process_tracing_backend.h index 20c7bd2..a3c23da 100644 --- a/include/perfetto/tracing/internal/in_process_tracing_backend.h +++ b/include/perfetto/tracing/internal/in_process_tracing_backend.h
@@ -35,7 +35,8 @@ // instance in-process. Instantiated when the embedder calls // Tracing::Initialize(kInProcessBackend). Solves most in-app-only tracing // use-cases. -class PERFETTO_EXPORT InProcessTracingBackend : public TracingBackend { +class PERFETTO_COMPONENT_EXPORT InProcessTracingBackend + : public TracingBackend { public: static TracingBackend* GetInstance();
diff --git a/include/perfetto/tracing/internal/system_tracing_backend.h b/include/perfetto/tracing/internal/system_tracing_backend.h index 69a1cad..08ea7bd 100644 --- a/include/perfetto/tracing/internal/system_tracing_backend.h +++ b/include/perfetto/tracing/internal/system_tracing_backend.h
@@ -35,7 +35,7 @@ // together with system traces, useful to correlate on the timeline system // events (e.g. scheduling slices from the kernel) with in-app events. namespace internal { -class PERFETTO_EXPORT SystemTracingBackend : public TracingBackend { +class PERFETTO_COMPONENT_EXPORT SystemTracingBackend : public TracingBackend { public: static TracingBackend* GetInstance();
diff --git a/include/perfetto/tracing/internal/tracing_backend_fake.h b/include/perfetto/tracing/internal/tracing_backend_fake.h index 92c8ea1..c723a54 100644 --- a/include/perfetto/tracing/internal/tracing_backend_fake.h +++ b/include/perfetto/tracing/internal/tracing_backend_fake.h
@@ -25,7 +25,7 @@ // A built-in implementation of TracingBackend that fails any attempt to create // a tracing session. -class PERFETTO_EXPORT TracingBackendFake : public TracingBackend { +class PERFETTO_COMPONENT_EXPORT TracingBackendFake : public TracingBackend { public: static TracingBackend* GetInstance();
diff --git a/include/perfetto/tracing/internal/tracing_muxer.h b/include/perfetto/tracing/internal/tracing_muxer.h index bef7191..7d87771 100644 --- a/include/perfetto/tracing/internal/tracing_muxer.h +++ b/include/perfetto/tracing/internal/tracing_muxer.h
@@ -47,7 +47,7 @@ // and methods that are required to implement them should go into // src/tracing/internal/tracing_muxer_impl.h instead: that one can pull in // perfetto headers outside of public, this one cannot. -class PERFETTO_EXPORT TracingMuxer { +class PERFETTO_COMPONENT_EXPORT TracingMuxer { public: static TracingMuxer* Get() { return instance_; }
diff --git a/include/perfetto/tracing/internal/track_event_internal.h b/include/perfetto/tracing/internal/track_event_internal.h index be2c528..806a730 100644 --- a/include/perfetto/tracing/internal/track_event_internal.h +++ b/include/perfetto/tracing/internal/track_event_internal.h
@@ -65,7 +65,7 @@ // A callback interface for observing track event tracing sessions starting and // stopping. See TrackEvent::{Add,Remove}SessionObserver. Note that all methods // will be called on an internal Perfetto thread. -class PERFETTO_EXPORT TrackEventSessionObserver { +class PERFETTO_COMPONENT_EXPORT TrackEventSessionObserver { public: virtual ~TrackEventSessionObserver(); // Called when a track event tracing session is configured. Note tracing isn't @@ -83,7 +83,7 @@ namespace internal { class TrackEventCategoryRegistry; -class PERFETTO_EXPORT BaseTrackEventInternedDataIndex { +class PERFETTO_COMPONENT_EXPORT BaseTrackEventInternedDataIndex { public: virtual ~BaseTrackEventInternedDataIndex(); @@ -165,7 +165,7 @@ // The backend portion of the track event trace point implemention. Outlined to // a separate .cc file so it can be shared by different track event category // namespaces. -class PERFETTO_EXPORT TrackEventInternal { +class PERFETTO_COMPONENT_EXPORT TrackEventInternal { public: static bool Initialize( const TrackEventCategoryRegistry&,
diff --git a/include/perfetto/tracing/internal/track_event_interned_fields.h b/include/perfetto/tracing/internal/track_event_interned_fields.h index 50e3370..ec5449f 100644 --- a/include/perfetto/tracing/internal/track_event_interned_fields.h +++ b/include/perfetto/tracing/internal/track_event_interned_fields.h
@@ -27,7 +27,7 @@ // to share the interning buffers with Perfetto internals (e.g. // perfetto::TracedValue implementation). -struct PERFETTO_EXPORT InternedEventCategory +struct PERFETTO_COMPONENT_EXPORT InternedEventCategory : public TrackEventInternedDataIndex< InternedEventCategory, perfetto::protos::pbzero::InternedData::kEventCategoriesFieldNumber, @@ -41,7 +41,7 @@ size_t length); }; -struct PERFETTO_EXPORT InternedEventName +struct PERFETTO_COMPONENT_EXPORT InternedEventName : public TrackEventInternedDataIndex< InternedEventName, perfetto::protos::pbzero::InternedData::kEventNamesFieldNumber, @@ -54,7 +54,7 @@ const char* value); }; -struct PERFETTO_EXPORT InternedDebugAnnotationName +struct PERFETTO_COMPONENT_EXPORT InternedDebugAnnotationName : public TrackEventInternedDataIndex< InternedDebugAnnotationName, perfetto::protos::pbzero::InternedData:: @@ -68,7 +68,7 @@ const char* value); }; -struct PERFETTO_EXPORT InternedDebugAnnotationValueTypeName +struct PERFETTO_COMPONENT_EXPORT InternedDebugAnnotationValueTypeName : public TrackEventInternedDataIndex< InternedDebugAnnotationValueTypeName, perfetto::protos::pbzero::InternedData::
diff --git a/include/perfetto/tracing/platform.h b/include/perfetto/tracing/platform.h index f54f056..eb302dd 100644 --- a/include/perfetto/tracing/platform.h +++ b/include/perfetto/tracing/platform.h
@@ -44,7 +44,7 @@ // Base class for thread-local objects. This is to get a basic object vtable and // delegate destruction to the embedder. See Platform::CreateThreadLocalObject. -class PERFETTO_EXPORT PlatformThreadLocalObject { +class PERFETTO_COMPONENT_EXPORT PlatformThreadLocalObject { public: // Implemented by perfetto internal code. The embedder must call this when // implementing GetOrCreateThreadLocalObject() to create an instance for the @@ -53,7 +53,7 @@ virtual ~PlatformThreadLocalObject(); }; -class PERFETTO_EXPORT Platform { +class PERFETTO_COMPONENT_EXPORT Platform { public: // Embedders can use this unless they have custom needs (e.g. Chrome wanting // to use its own base class for TLS).
diff --git a/include/perfetto/tracing/string_helpers.h b/include/perfetto/tracing/string_helpers.h index 8511d1a..1639879 100644 --- a/include/perfetto/tracing/string_helpers.h +++ b/include/perfetto/tracing/string_helpers.h
@@ -26,7 +26,7 @@ // A wrapper for marking strings that can't be determined to be static at build // time, but are in fact static. -class PERFETTO_EXPORT StaticString { +class PERFETTO_COMPONENT_EXPORT StaticString { public: // Implicit constructor for string literals. template <size_t N> @@ -70,7 +70,7 @@ // A explicit wrapper for marking strings as dynamic to ensure that perfetto // doesn't try to cache the pointer value. -class PERFETTO_EXPORT DynamicString { +class PERFETTO_COMPONENT_EXPORT DynamicString { public: explicit DynamicString(const std::string& str) : value(str.data()), length(str.length()) {}
diff --git a/include/perfetto/tracing/traced_value.h b/include/perfetto/tracing/traced_value.h index cb659bc..9a98ead 100644 --- a/include/perfetto/tracing/traced_value.h +++ b/include/perfetto/tracing/traced_value.h
@@ -120,12 +120,12 @@ // TODO(altimin): Currently EventContext can be null due the need to support // TracedValue-based serialisation with the Chrome's TraceLog. After this is // gone, the second parameter should be changed to EventContext&. -PERFETTO_EXPORT TracedValue +PERFETTO_COMPONENT_EXPORT TracedValue CreateTracedValueFromProto(protos::pbzero::DebugAnnotation*, EventContext* = nullptr); } -class PERFETTO_EXPORT TracedValue { +class PERFETTO_COMPONENT_EXPORT TracedValue { public: TracedValue(const TracedValue&) = delete; TracedValue& operator=(const TracedValue&) = delete; @@ -204,7 +204,7 @@ event_context_); } -class PERFETTO_EXPORT TracedArray { +class PERFETTO_COMPONENT_EXPORT TracedArray { public: // implicit TracedArray(TracedValue); @@ -241,7 +241,7 @@ internal::CheckedScope checked_scope_; }; -class PERFETTO_EXPORT TracedDictionary { +class PERFETTO_COMPONENT_EXPORT TracedDictionary { public: // implicit TracedDictionary(TracedValue);
diff --git a/include/perfetto/tracing/tracing.h b/include/perfetto/tracing/tracing.h index 9aae9e8..b1b34a9 100644 --- a/include/perfetto/tracing/tracing.h +++ b/include/perfetto/tracing/tracing.h
@@ -138,7 +138,7 @@ }; // The entry-point for using perfetto. -class PERFETTO_EXPORT Tracing { +class PERFETTO_COMPONENT_EXPORT Tracing { public: // Initializes Perfetto with the given backends in the calling process and/or // with a user-provided backend. No-op if called more than once. @@ -188,7 +188,7 @@ Tracing() = delete; }; -class PERFETTO_EXPORT TracingSession { +class PERFETTO_COMPONENT_EXPORT TracingSession { public: virtual ~TracingSession();
diff --git a/include/perfetto/tracing/tracing_backend.h b/include/perfetto/tracing/tracing_backend.h index 67b0d2e..d8efbe0 100644 --- a/include/perfetto/tracing/tracing_backend.h +++ b/include/perfetto/tracing/tracing_backend.h
@@ -43,7 +43,7 @@ class Producer; class ProducerEndpoint; -class PERFETTO_EXPORT TracingBackend { +class PERFETTO_COMPONENT_EXPORT TracingBackend { public: virtual ~TracingBackend();
diff --git a/include/perfetto/tracing/tracing_policy.h b/include/perfetto/tracing/tracing_policy.h index bd93666..e5e4f66 100644 --- a/include/perfetto/tracing/tracing_policy.h +++ b/include/perfetto/tracing/tracing_policy.h
@@ -27,7 +27,7 @@ // Applies policy decisions, such as allowing or denying connections, when // certain tracing SDK events occur. All methods are called on an internal // perfetto thread. -class PERFETTO_EXPORT TracingPolicy { +class PERFETTO_COMPONENT_EXPORT TracingPolicy { public: virtual ~TracingPolicy();
diff --git a/include/perfetto/tracing/track.h b/include/perfetto/tracing/track.h index cee0be6..adc8b50 100644 --- a/include/perfetto/tracing/track.h +++ b/include/perfetto/tracing/track.h
@@ -79,7 +79,7 @@ // // perfetto::TrackEvent::EraseTrackDescriptor(track); // -struct PERFETTO_EXPORT Track { +struct PERFETTO_COMPONENT_EXPORT Track { const uint64_t uuid; const uint64_t parent_uuid; constexpr Track() : uuid(0), parent_uuid(0) {} @@ -154,7 +154,7 @@ // A process track represents events that describe the state of the entire // application (e.g., counter events). Currently a ProcessTrack can only // represent the current process. -struct PERFETTO_EXPORT ProcessTrack : public Track { +struct PERFETTO_COMPONENT_EXPORT ProcessTrack : public Track { const base::PlatformProcessId pid; static ProcessTrack Current() { return ProcessTrack(); } @@ -169,7 +169,7 @@ // A thread track is associated with a specific thread of execution. Currently // only threads in the current process can be referenced. -struct PERFETTO_EXPORT ThreadTrack : public Track { +struct PERFETTO_COMPONENT_EXPORT ThreadTrack : public Track { const base::PlatformProcessId pid; const base::PlatformThreadId tid; @@ -315,9 +315,9 @@ // descriptor for that track (see *Track::Serialize) or 2) a serialized // descriptor stored in the registry which may have additional metadata (e.g., // track name). -// TODO(eseckler): Remove PERFETTO_EXPORT once Chromium no longer calls -// TrackRegistry::InitializeInstance() directly. -class PERFETTO_EXPORT TrackRegistry { +// TODO(eseckler): Remove PERFETTO_COMPONENT_EXPORT once Chromium no longer +// calls TrackRegistry::InitializeInstance() directly. +class PERFETTO_COMPONENT_EXPORT TrackRegistry { public: using SerializedTrackDescriptor = std::string;
diff --git a/include/perfetto/tracing/track_event_category_registry.h b/include/perfetto/tracing/track_event_category_registry.h index 8b9d8f5..b3dcf93 100644 --- a/include/perfetto/tracing/track_event_category_registry.h +++ b/include/perfetto/tracing/track_event_category_registry.h
@@ -29,7 +29,7 @@ // A compile-time representation of a track event category. See // PERFETTO_DEFINE_CATEGORIES for registering your own categories. -struct PERFETTO_EXPORT Category { +struct PERFETTO_COMPONENT_EXPORT Category { using Tags = std::array<const char*, 4>; const char* const name = nullptr; @@ -150,7 +150,7 @@ // container type to make it less likely for trace points to accidentally start // using dynamic categories. Events with dynamic categories will always be // slightly more expensive than regular events, so use them sparingly. -class PERFETTO_EXPORT DynamicCategory final { +class PERFETTO_COMPONENT_EXPORT DynamicCategory final { public: explicit DynamicCategory(const std::string& name_) : name(name_) {} explicit DynamicCategory(const char* name_) : name(name_) {} @@ -190,7 +190,7 @@ // Holds all the registered categories for one category namespace. See // PERFETTO_DEFINE_CATEGORIES for building the registry. -class PERFETTO_EXPORT TrackEventCategoryRegistry { +class PERFETTO_COMPONENT_EXPORT TrackEventCategoryRegistry { public: constexpr TrackEventCategoryRegistry(size_t category_count, const Category* categories,
diff --git a/include/perfetto/tracing/track_event_legacy.h b/include/perfetto/tracing/track_event_legacy.h index 197d559..819352c 100644 --- a/include/perfetto/tracing/track_event_legacy.h +++ b/include/perfetto/tracing/track_event_legacy.h
@@ -182,7 +182,7 @@ // Built-in implementation for events referring to the current thread. template <> -ThreadTrack PERFETTO_EXPORT +ThreadTrack PERFETTO_COMPONENT_EXPORT ConvertThreadId(const PerfettoLegacyCurrentThreadId&); } // namespace legacy @@ -190,7 +190,7 @@ namespace internal { // LegacyTraceId encapsulates an ID that can either be an integer or pointer. -class PERFETTO_EXPORT LegacyTraceId { +class PERFETTO_COMPONENT_EXPORT LegacyTraceId { public: // Can be combined with WithScope. class LocalId { @@ -303,7 +303,7 @@ namespace perfetto { namespace internal { -class PERFETTO_EXPORT TrackEventLegacy { +class PERFETTO_COMPONENT_EXPORT TrackEventLegacy { public: static constexpr protos::pbzero::TrackEvent::Type PhaseToType(char phase) { // clang-format off
diff --git a/include/perfetto/tracing/track_event_state_tracker.h b/include/perfetto/tracing/track_event_state_tracker.h index e97f035..42be5f7 100644 --- a/include/perfetto/tracing/track_event_state_tracker.h +++ b/include/perfetto/tracing/track_event_state_tracker.h
@@ -36,7 +36,7 @@ // A helper for keeping track of incremental state when intercepting track // events. -class PERFETTO_EXPORT TrackEventStateTracker { +class PERFETTO_COMPONENT_EXPORT TrackEventStateTracker { public: ~TrackEventStateTracker();
diff --git a/src/base/logging.cc b/src/base/logging.cc index 7f54605..8bd74fc 100644 --- a/src/base/logging.cc +++ b/src/base/logging.cc
@@ -53,7 +53,8 @@ #if PERFETTO_BUILDFLAG(PERFETTO_STDERR_CRASH_DUMP) // __attribute__((constructor)) causes a static initializer that automagically // early runs this function before the main(). -void PERFETTO_EXPORT __attribute__((constructor)) InitDebugCrashReporter() { +void PERFETTO_COMPONENT_EXPORT __attribute__((constructor)) +InitDebugCrashReporter() { // This function is defined in debug_crash_stack_trace.cc. // The dynamic initializer is in logging.cc because logging.cc is included // in virtually any target that depends on base. Having it in
diff --git a/src/base/utils.cc b/src/base/utils.cc index b4da80c..a4c0f3f 100644 --- a/src/base/utils.cc +++ b/src/base/utils.cc
@@ -82,7 +82,8 @@ // If we are building with -msse4 check that the CPU actually supports it. // This file must be kept in sync with gn/standalone/BUILD.gn. -void PERFETTO_EXPORT __attribute__((constructor)) CheckCpuOptimizations() { +void PERFETTO_COMPONENT_EXPORT __attribute__((constructor)) +CheckCpuOptimizations() { uint32_t eax = 0, ebx = 0, ecx = 0, edx = 0; PERFETTO_GETCPUID(eax, ebx, ecx, edx, 1, 0);
diff --git a/src/protozero/protoc_plugin/cppgen_plugin.cc b/src/protozero/protoc_plugin/cppgen_plugin.cc index 164fb63..fdc6821 100644 --- a/src/protozero/protoc_plugin/cppgen_plugin.cc +++ b/src/protozero/protoc_plugin/cppgen_plugin.cc
@@ -532,7 +532,8 @@ void CppObjGenerator::GenClassDecl(const Descriptor* msg, Printer* p) const { std::string full_name = GetFullName(msg); p->Print( - "\nclass PERFETTO_EXPORT $n$ : public ::protozero::CppMessageObj {\n", + "\nclass PERFETTO_COMPONENT_EXPORT $n$ : public " + "::protozero::CppMessageObj {\n", "n", full_name); p->Print(" public:\n"); p->Indent();