Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/vm/jfr/support/jfrTraceIdExtension.hpp
38920 views
/*1* Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#ifndef SHARE_VM_JFR_SUPPORT_JFRTRACEIDEXTENSION_HPP25#define SHARE_VM_JFR_SUPPORT_JFRTRACEIDEXTENSION_HPP2627#include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.hpp"2829#define DEFINE_TRACE_ID_FIELD mutable traceid _trace_id3031#define DEFINE_TRACE_ID_METHODS \32traceid trace_id() const { return _trace_id; } \33traceid* const trace_id_addr() const { return &_trace_id; } \34void set_trace_id(traceid id) const { _trace_id = id; }3536#define DEFINE_TRACE_ID_SIZE \37static size_t trace_id_size() { return sizeof(traceid); }3839#define INIT_ID(data) JfrTraceId::assign(data)40#define REMOVE_ID(k) JfrTraceId::remove(k);41#define RESTORE_ID(k) JfrTraceId::restore(k);4243class JfrTraceFlag {44private:45mutable jbyte _flags;46public:47JfrTraceFlag() : _flags(0) {}48explicit JfrTraceFlag(jbyte flags) : _flags(flags) {}49void set_flag(jbyte flag) const {50_flags |= flag;51}52void clear_flag(jbyte flag) const {53_flags &= (~flag);54}55jbyte flags() const { return _flags; }56bool is_set(jbyte flag) const {57return (_flags & flag) != 0;58}59jbyte* const flags_addr() const {60return &_flags;61}62};6364#define DEFINE_TRACE_FLAG mutable JfrTraceFlag _trace_flags6566#define DEFINE_TRACE_FLAG_ACCESSOR \67void set_trace_flag(jbyte flag) const { \68_trace_flags.set_flag(flag); \69} \70jbyte trace_flags() const { \71return _trace_flags.flags(); \72} \73bool is_trace_flag_set(jbyte flag) const { \74return _trace_flags.is_set(flag); \75} \76jbyte* const trace_flags_addr() const { \77return _trace_flags.flags_addr(); \78}7980#endif // SHARE_VM_JFR_SUPPORT_JFRTRACEIDEXTENSION_HPP818283