more cleanup of telemetry support

remove superfluous cmake changes
rename profiler to telemetry to avoid confusion
meow-7.2.2
Beq 2021-03-21 14:59:02 +00:00
parent 1f9246f0f3
commit eb0bfc9e10
11 changed files with 107 additions and 33 deletions

View File

@ -139,11 +139,6 @@ if (WINDOWS)
# /arch:SSE2
/fp:fast
)
# <FS:Beq> Add Tracy profiler support
if (USE_TRACY_PROFILER)
add_definitions( /DTRACY_ENABLE /DTRACY_NO_FASTTIMERS )
endif()
# </FS:Beq>
# Nicky: x64 implies SSE2
if( ADDRESS_SIZE EQUAL 32 )
add_definitions( /arch:SSE2 )

View File

@ -257,6 +257,7 @@ set(llcommon_HEADER_FILES
# <FS:ND> Add all nd* files. memory pool, intrinsics, ...
# <FS:Beq> Tracy Profiler support
list(APPEND llcommon_SOURCE_FILES fstelemetry.cpp)
if (USE_TRACY_PROFILER)
list(APPEND llcommon_SOURCE_FILES FSTracyClient.cpp)
endif()

View File

@ -10,19 +10,9 @@
//
// Define TRACY_ENABLE to enable profiler.
// #define __CYGWIN__
#include "common/TracySystem.cpp"
#ifdef TRACY_ENABLE
// <FS:Beq> are we actively profiling?
// At some point this should move to fsprofiler.cpp to correspond with the headerfile
#ifdef TRACY_ENABLE
namespace FSProfiler
{
bool active{false};
}
#endif
// </FS:Beq>
#ifdef _MSC_VER
# pragma warning(push, 0)

View File

@ -0,0 +1,31 @@
/**
* @file fstelemetry.cpp
* @brief fstelemetry Telemetry abstraction for FS
*
* $LicenseInfo:firstyear=2021&license=fsviewerlgpl$
* Phoenix Firestorm Viewer Source Code
* Copyright (C) 2021, The Phoenix Firestorm Project, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* The Phoenix Firestorm Project, Inc., 1831 Oakwood Drive, Fairmont, Minnesota 56031-3225 USA
* http://www.firestormviewer.org
* $/LicenseInfo$
*/
#include "fstelemetry.h"
namespace FSTelemetry
{
bool active{false};
}

View File

@ -1,32 +1,36 @@
#pragma once
#ifndef FS_PROFILER_H_INCLUDED
#define FS_PROFILER_H_INCLUDED
#ifndef FS_TELEMETRY_H_INCLUDED
#define FS_TELEMETRY_H_INCLUDED
// define a simple set of empty macros that allow us to build without the Tracy profiler installed in 3p
// this is similar to the profiler abstraction used by LL but as they have no plans to release that any time soon we'll replace it
// Just a minimal set at the moment will add locks/gpu/memory and other stuff later
// Just a minimal set at the moment will add locks/gpu/memory and other stuff later.
#ifdef TRACY_ENABLE
#include "Tracy.hpp"
namespace FSProfiler
{
extern bool active;
}
#define FSZone ZoneNamed( ___tracy_scoped_zone, FSProfiler::active)
#define FSZoneN( name ) ZoneNamedN( ___tracy_scoped_zone, name, FSProfiler::active)
#define FSZoneC(color) ZoneNamedC( ___tracy_scoped_zone, color, FSProfiler::active)
#define FSZoneNC(name, color) ZoneNamedNC( ___tracy_scoped_zone, name, color, FSProfiler::active)
#define FSZone ZoneNamed( ___tracy_scoped_zone, FSTelemetry::active)
#define FSZoneN( name ) ZoneNamedN( ___tracy_scoped_zone, name, FSTelemetry::active)
#define FSZoneC( color ) ZoneNamedC( ___tracy_scoped_zone, color, FSTelemetry::active)
#define FSZoneNC( name, color ) ZoneNamedNC( ___tracy_scoped_zone, name, color, FSTelemetry::active)
#define FSPlot( name, value ) TracyPlot( name, value)
#define FSFrameMark FrameMark
#define FSTelemetryIsConnected TracyIsConnected
#else
#define FSZone
#define FSZoneN( name )
#define FSZoneC(color)
#define FSZoneNC(name, color)
#define FSZoneC( color )
#define FSZoneNC( name, color )
#define FSPlot( name, value )
#define FSFrameMark
#define FSTelemetryIsConnected
#endif // TRACY_ENABLE
namespace FSTelemetry
{
extern bool active;
}
#endif

View File

@ -41,7 +41,7 @@
// <FS:Beq> Add Tracy profiler support
// #define LL_RECORD_BLOCK_TIME(timer_stat) \
// const LLTrace::BlockTimer& LL_GLUE_TOKENS(block_time_recorder, __LINE__)(LLTrace::timeThisBlock(timer_stat)); (void)LL_GLUE_TOKENS(block_time_recorder, __LINE__);
#include "fsprofiler.h"
#include "fstelemetry.h"
#ifdef TRACY_ENABLE
// #undef TRACY_NO_FASTTIMERS // Uncomment if you want FASTTIMERS as well.
#ifdef TRACY_NO_FASTTIMERS

View File

@ -33,7 +33,6 @@
#include "llfilesystem.h"
#include "llfasttimer.h"
#include "lldiskcache.h"
#include "fsprofiler.h"
const S32 LLFileSystem::READ = 0x00000001;
const S32 LLFileSystem::WRITE = 0x00000002;

View File

@ -24628,10 +24628,10 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>0</integer>
</map>
<key>FSTracyEnableWhenConnected</key>
<key>FSTelemetryEnableWhenConnected</key>
<map>
<key>Comment</key>
<string>Enable profiling as soon as a server connects</string>
<string>Enable telemetry as soon as a server connects</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@ -24639,6 +24639,17 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Value</key>
<integer>1</integer>
</map>
<key>FSTelemetryActive</key>
<map>
<key>Comment</key>
<string>Enable profiling as soon as a server connects. Off by default and non-persistent. Use with FSTelemetryEnableWhenConnected to initiate on startup</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
</map>
<key>FSFilterGrowlKeywordDuplicateIMs</key>
<map>
<key>Comment</key>

View File

@ -282,7 +282,7 @@
#include "fsradar.h"
#include "fsassetblacklist.h"
#include "fsprofiler.h" // <FS:Beq> Tracy profiler support
#include "fstelemetry.h" // <FS:Beq> Tracy profiler support
#if (LL_LINUX || LL_SOLARIS) && LL_GTK
#include "glib.h"

View File

@ -9475,6 +9475,20 @@ class LLAdvancedToggleDoubleClickTeleport: public view_listener_t
}
};
// <FS:Beq> Add telemetry controls to the viewer menus
class FSTelemetryToggleActive : public view_listener_t
{
protected:
bool handleEvent(const LLSD& userdata)
{
BOOL checked = gSavedSettings.getBOOL( "FSTelemetryActive" );
gSavedSettings.setBOOL( "FSTelemetryActive", !checked );
FSTelemetry::active = !checked;
return true;
}
};
// </FS:Beq>
void menu_toggle_attached_lights(void* user_data)
{
LLPipeline::sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights");
@ -11831,6 +11845,9 @@ void initialize_menus()
//Develop (clear cache immediately)
commit.add("Develop.ClearCache", boost::bind(&handle_cache_clear_immediately) );
// <FS:Beq/> Add telemetry controls to the viewer Develop menu (Toggle profiling)
view_listener_t::addMenu(new FSTelemetryToggleActive(), "Develop.ToggleTelemetry");
// Admin >Object
view_listener_t::addMenu(new LLAdminForceTakeCopy(), "Admin.ForceTakeCopy");
view_listener_t::addMenu(new LLAdminHandleObjectOwnerSelf(), "Admin.HandleObjectOwnerSelf");

View File

@ -3568,6 +3568,32 @@
function="Advanced.ToggleShowObjectUpdates" />
</menu_item_check>
</menu>
<menu
create_jump_keys="true"
label="Profiling/Telemetry"
name="Enable / Disable telemetry capture"
tear_off="true">
<menu_item_check
label="Profiling"
name="Profiling">
<menu_item_check.on_check
function="CheckControl"
parameter="FSTelemetryActive" />
<menu_item_check.on_click
function="Develop.ToggleTelemetry"
parameter="FSTelemetryActive" />
</menu_item_check>
<menu_item_check
label="Start when connected"
name="Start when telemetry client connects">
<menu_item_check.on_check
function="CheckControl"
parameter="FSTelemetryEnableWhenConnected" />
<menu_item_check.on_click
function="ToggleControl"
parameter="FSTelemetryEnableWhenConnected" />
</menu_item_check>
</menu>
<menu_item_separator/>