提交 61226506 编写于 作者: D Denghui Dong 提交者: D-D-H

[Backport] 8236263: Remove experimental streaming events

Summary:

Test Plan: jdk/jfr

Reviewed-by: yuleil

Issue: https://github.com/alibaba/dragonwell8/issues/112
上级 cab9c7ff
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
......@@ -936,36 +936,6 @@
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
</Event>
<Event name="FlushStorage" category="Flight Recorder" label="Flush Storage" thread="false" experimental="true">
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
<Field type="ulong" name="elements" label="Elements Written" />
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
</Event>
<Event name="FlushStacktrace" category="Flight Recorder" label="Flush Stacktrace" thread="false" experimental="true">
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
<Field type="ulong" name="elements" label="Elements Written" />
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
</Event>
<Event name="FlushStringPool" category="Flight Recorder" label="Flush String Pool" thread="false" experimental="true">
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
<Field type="ulong" name="elements" label="Elements Written" />
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
</Event>
<Event name="FlushMetadata" category="Flight Recorder" label="Flush Metadata" thread="false" experimental="true">
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
<Field type="ulong" name="elements" label="Elements Written" />
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
</Event>
<Event name="FlushTypeSet" category="Flight Recorder" label="Flush Type Set" thread="false" experimental="true">
<Field type="ulong" name="flushId" label="Flush Identifier" relation="FlushId" />
<Field type="ulong" name="elements" label="Elements Written" />
<Field type="ulong" contentType="bytes" name="size" label="Size Written" />
</Event>
<Type name="ZStatisticsCounterType" label="Z Statistics Counter">
<Field type="string" name="counter" label="Counter" />
</Type>
......
......@@ -58,13 +58,12 @@
// incremented on each flushpoint
static u8 flushpoint_id = 0;
template <typename E, typename Instance, size_t(Instance::*func)()>
template <typename Instance, size_t(Instance::*func)()>
class Content {
private:
Instance& _instance;
u4 _elements;
public:
typedef E EventType;
Content(Instance& instance) : _instance(instance), _elements(0) {}
bool process() {
_elements = (u4)(_instance.*func)();
......@@ -82,7 +81,6 @@ class WriteContent : public StackObj {
Content& _content;
const int64_t _start_offset;
public:
typedef typename Content::EventType EventType;
WriteContent(JfrChunkWriter& cw, Content& content) :
_start_time(JfrTicks::now()),
......@@ -128,14 +126,6 @@ class WriteContent : public StackObj {
return (u4)(end_offset() - start_offset());
}
static bool is_event_enabled() {
return EventType::is_enabled();
}
static u8 event_id() {
return EventType::eventId;
}
void write_elements(int64_t offset) {
_cw.write_padded_at_offset<u4>(elements(), offset);
}
......@@ -200,22 +190,15 @@ static u4 invoke(Functor& f) {
}
template <typename Functor>
static void write_flush_event(Functor& f) {
if (Functor::is_event_enabled()) {
typename Functor::EventType e(UNTIMED);
static u4 invoke_with_flush_event(Functor& f) {
const u4 elements = invoke(f);
EventFlush e(UNTIMED);
e.set_starttime(f.start_time());
e.set_endtime(f.end_time());
e.set_flushId(flushpoint_id);
e.set_elements(f.elements());
e.set_size(f.size());
e.commit();
}
}
template <typename Functor>
static u4 invoke_with_flush_event(Functor& f) {
const u4 elements = invoke(f);
write_flush_event(f);
return elements;
}
......@@ -227,7 +210,6 @@ class StackTraceRepository : public StackObj {
bool _clear;
public:
typedef EventFlushStacktrace EventType;
StackTraceRepository(JfrStackTraceRepository& repo, JfrChunkWriter& cw, bool clear) :
_repo(repo), _cw(cw), _elements(0), _clear(clear) {}
bool process() {
......@@ -243,7 +225,7 @@ typedef WriteCheckpointEvent<StackTraceRepository> WriteStackTrace;
static u4 flush_stacktrace(JfrStackTraceRepository& stack_trace_repo, JfrChunkWriter& chunkwriter) {
StackTraceRepository str(stack_trace_repo, chunkwriter, false);
WriteStackTrace wst(chunkwriter, str, TYPE_STACKTRACE);
return invoke_with_flush_event(wst);
return invoke(wst);
}
static u4 write_stacktrace(JfrStackTraceRepository& stack_trace_repo, JfrChunkWriter& chunkwriter, bool clear) {
......@@ -252,14 +234,14 @@ static u4 write_stacktrace(JfrStackTraceRepository& stack_trace_repo, JfrChunkWr
return invoke(wst);
}
typedef Content<EventFlushStorage, JfrStorage, &JfrStorage::write> Storage;
typedef Content<JfrStorage, &JfrStorage::write> Storage;
typedef WriteContent<Storage> WriteStorage;
static size_t flush_storage(JfrStorage& storage, JfrChunkWriter& chunkwriter) {
assert(chunkwriter.is_valid(), "invariant");
Storage fsf(storage);
WriteStorage fs(chunkwriter, fsf);
return invoke_with_flush_event(fs);
return invoke(fs);
}
static size_t write_storage(JfrStorage& storage, JfrChunkWriter& chunkwriter) {
......@@ -269,15 +251,15 @@ static size_t write_storage(JfrStorage& storage, JfrChunkWriter& chunkwriter) {
return invoke(fs);
}
typedef Content<EventFlushStringPool, JfrStringPool, &JfrStringPool::write> StringPool;
typedef Content<EventFlushStringPool, JfrStringPool, &JfrStringPool::write_at_safepoint> StringPoolSafepoint;
typedef Content<JfrStringPool, &JfrStringPool::write> StringPool;
typedef Content<JfrStringPool, &JfrStringPool::write_at_safepoint> StringPoolSafepoint;
typedef WriteCheckpointEvent<StringPool> WriteStringPool;
typedef WriteCheckpointEvent<StringPoolSafepoint> WriteStringPoolSafepoint;
static u4 flush_stringpool(JfrStringPool& string_pool, JfrChunkWriter& chunkwriter) {
StringPool sp(string_pool);
WriteStringPool wsp(chunkwriter, sp, TYPE_STRING);
return invoke_with_flush_event(wsp);
return invoke(wsp);
}
static u4 write_stringpool(JfrStringPool& string_pool, JfrChunkWriter& chunkwriter) {
......@@ -292,20 +274,19 @@ static u4 write_stringpool_safepoint(JfrStringPool& string_pool, JfrChunkWriter&
return invoke(wsps);
}
typedef Content<EventFlushTypeSet, JfrCheckpointManager, &JfrCheckpointManager::flush_type_set> FlushTypeSetFunctor;
typedef Content<JfrCheckpointManager, &JfrCheckpointManager::flush_type_set> FlushTypeSetFunctor;
typedef WriteContent<FlushTypeSetFunctor> FlushTypeSet;
static u4 flush_typeset(JfrCheckpointManager& checkpoint_manager, JfrChunkWriter& chunkwriter) {
FlushTypeSetFunctor flush_type_set(checkpoint_manager);
FlushTypeSet fts(chunkwriter, flush_type_set);
return invoke_with_flush_event(fts);
return invoke(fts);
}
class MetadataEvent : public StackObj {
private:
JfrChunkWriter& _cw;
public:
typedef EventFlushMetadata EventType;
MetadataEvent(JfrChunkWriter& cw) : _cw(cw) {}
bool process() {
JfrMetadataEvent::write(_cw);
......@@ -320,7 +301,7 @@ static u4 flush_metadata(JfrChunkWriter& chunkwriter) {
assert(chunkwriter.is_valid(), "invariant");
MetadataEvent me(chunkwriter);
WriteMetadata wm(chunkwriter, me);
return invoke_with_flush_event(wm);
return invoke(wm);
}
static u4 write_metadata(JfrChunkWriter& chunkwriter) {
......@@ -606,7 +587,7 @@ size_t JfrRecorderService::flush() {
return total_elements;
}
typedef Content<EventFlush, JfrRecorderService, &JfrRecorderService::flush> FlushFunctor;
typedef Content<JfrRecorderService, &JfrRecorderService::flush> FlushFunctor;
typedef WriteContent<FlushFunctor> Flush;
void JfrRecorderService::invoke_flush() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册