Skip to content
Permalink
Browse files

8236263: Remove experimental streaming events

Reviewed-by: rehn, mseledtsov
  • Loading branch information
Erik Gahlin
Erik Gahlin committed Jan 10, 2020
1 parent 0b542e3 commit 2c7c8023edaf5e0411685cfbdb0650580d080ed7
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>

<!--
Copyright (c) 2012, 2019, 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
@@ -1023,36 +1023,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="DeoptimizationReason" label="Deoptimization Reason">
<Field type="string" name="reason" label="Reason" />
</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);
}
@@ -198,23 +188,16 @@ static u4 invoke(Functor& f) {
return f.elements();
}

template <typename Functor>
static void write_flush_event(Functor& f) {
if (Functor::is_event_enabled()) {
typename Functor::EventType 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);
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();
return elements;
}

@@ -226,7 +209,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() {
@@ -242,7 +224,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) {
@@ -251,14 +233,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) {
@@ -268,15 +250,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) {
@@ -291,20 +273,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);
@@ -319,7 +300,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) {
@@ -651,7 +632,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() {
@@ -671,32 +671,7 @@
</event>

<event name="jdk.Flush">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushStorage">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushStacktrace">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushStringPool">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushMetadata">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushTypeSet">
<setting name="enabled">true</setting>
<setting name="enabled">false</setting>
<setting name="threshold">0 ns</setting>
</event>

@@ -671,32 +671,7 @@
</event>

<event name="jdk.Flush">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushStorage">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushStacktrace">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushStringPool">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushMetadata">
<setting name="enabled">true</setting>
<setting name="threshold">0 ns</setting>
</event>

<event name="jdk.FlushTypeSet">
<setting name="enabled">true</setting>
<setting name="enabled">false</setting>
<setting name="threshold">0 ns</setting>
</event>

0 comments on commit 2c7c802

Please sign in to comment.