Use finish_continuous_frame directly

This commit is contained in:
Imbris 2020-08-29 03:00:26 -04:00
parent 63d60c212c
commit 0683a40741
7 changed files with 15 additions and 9 deletions

View File

@ -6,6 +6,8 @@ rustflags = [
[alias] [alias]
generate = "run --package tools --" generate = "run --package tools --"
test-server = "-Zpackage-features run --bin veloren-server-cli --no-default-features" test-server = "-Zpackage-features run --bin veloren-server-cli --no-default-features"
tracy-server = "-Zunstable-options -Zpackage-features run --bin veloren-server-cli --no-default-features --features tracy --profile no_overflow"
test-voxygen = "-Zpackage-features run --bin veloren-voxygen --no-default-features --features gl" test-voxygen = "-Zpackage-features run --bin veloren-voxygen --no-default-features --features gl"
tracy-voxygen = "-Zunstable-options -Zpackage-features run --bin veloren-voxygen --no-default-features --features tracy gl --profile no_overflow"
server = "run --bin veloren-server-cli" server = "run --bin veloren-server-cli"

1
Cargo.lock generated
View File

@ -5040,7 +5040,6 @@ dependencies = [
"tracing-log", "tracing-log",
"tracing-subscriber", "tracing-subscriber",
"tracing-tracy", "tracing-tracy",
"tracy-client",
"treeculler", "treeculler",
"uvth 3.1.1", "uvth 3.1.1",
"vek 0.12.0", "vek 0.12.0",

View File

@ -11,6 +11,8 @@ lazy_static::lazy_static! {
pub use color::*; pub use color::*;
pub use dir::*; pub use dir::*;
#[cfg(feature = "tracy")] pub use tracy_client;
// https://discordapp.com/channels/676678179678715904/676685797524766720/723358438943621151 // https://discordapp.com/channels/676678179678715904/676685797524766720/723358438943621151
#[macro_export] #[macro_export]
macro_rules! span { macro_rules! span {

View File

@ -12,9 +12,9 @@ use crate::{
use common::clock::Clock; use common::clock::Clock;
use server::{Event, Input, Server, ServerSettings}; use server::{Event, Input, Server, ServerSettings};
use tracing::{info, Level}; use tracing::{info, Level};
use tracing_subscriber::{ use tracing_subscriber::{filter::LevelFilter, EnvFilter, FmtSubscriber};
filter::LevelFilter, layer::SubscriberExt, prelude::*, EnvFilter, FmtSubscriber, #[cfg(feature = "tracy")]
}; use tracing_subscriber::{layer::SubscriberExt, prelude::*};
use clap::{App, Arg}; use clap::{App, Arg};
use std::{io, sync::mpsc, time::Duration}; use std::{io, sync::mpsc, time::Duration};
@ -77,6 +77,8 @@ fn main() -> io::Result<()> {
.init(); .init();
#[cfg(not(feature = "tracy"))] #[cfg(not(feature = "tracy"))]
// TODO: when tracing gets per Layer filters re-enable this when the tracy feature is being
// used (and do the same in voxygen)
{ {
let subscriber = FmtSubscriber::builder() let subscriber = FmtSubscriber::builder()
.with_max_level(Level::ERROR) .with_max_level(Level::ERROR)
@ -122,7 +124,8 @@ fn main() -> io::Result<()> {
// Clean up the server after a tick. // Clean up the server after a tick.
server.cleanup(); server.cleanup();
tracing::trace!(tracy.frame_mark = true); #[cfg(feature = "tracy")]
common::util::tracy_client::finish_continuous_frame!();
match msg_r.try_recv() { match msg_r.try_recv() {
Ok(msg) => match msg { Ok(msg) => match msg {

View File

@ -4,7 +4,6 @@ use crate::{
persistence::character::CharacterLoader, ServerSettings, persistence::character::CharacterLoader, ServerSettings,
}; };
use common::{ use common::{
span,
comp::{ comp::{
Admin, AdminList, CanBuild, ChatMode, ChatType, ControlEvent, Controller, ForceUpdate, Ori, Admin, AdminList, CanBuild, ChatMode, ChatType, ControlEvent, Controller, ForceUpdate, Ori,
Player, Pos, Stats, UnresolvedChatMsg, Vel, Player, Pos, Stats, UnresolvedChatMsg, Vel,
@ -14,6 +13,7 @@ use common::{
validate_chat_msg, CharacterInfo, ChatMsgValidationError, ClientMsg, ClientState, validate_chat_msg, CharacterInfo, ChatMsgValidationError, ClientMsg, ClientState,
PlayerInfo, PlayerListUpdate, RequestStateError, ServerMsg, MAX_BYTES_CHAT_MSG, PlayerInfo, PlayerListUpdate, RequestStateError, ServerMsg, MAX_BYTES_CHAT_MSG,
}, },
span,
state::{BlockChange, Time}, state::{BlockChange, Time},
sync::Uid, sync::Uid,
terrain::{Block, TerrainChunkSize, TerrainGrid}, terrain::{Block, TerrainChunkSize, TerrainGrid},

View File

@ -12,7 +12,7 @@ version = "0.7.0"
gl = ["gfx_device_gl", "gfx_gl"] gl = ["gfx_device_gl", "gfx_gl"]
hot-anim = ["anim/use-dyn-lib"] hot-anim = ["anim/use-dyn-lib"]
singleplayer = ["server"] singleplayer = ["server"]
tracy = ["tracing-tracy", "tracy-client", "common/tracy"] tracy = ["tracing-tracy", "common/tracy"]
tweak = ["const-tweaker"] tweak = ["const-tweaker"]
default = ["gl", "singleplayer", "msgbox"] default = ["gl", "singleplayer", "msgbox"]
@ -84,7 +84,6 @@ tracing-subscriber = {version = "0.2.3", default-features = false, features = ["
# Tracy # Tracy
tracing-tracy = { version = "0.2.0", optional = true } tracing-tracy = { version = "0.2.0", optional = true }
tracy-client = { version = "0.8.0", optional = true }
[target.'cfg(target_os = "macos")'.dependencies] [target.'cfg(target_os = "macos")'.dependencies]
dispatch = "0.1.4" dispatch = "0.1.4"

View File

@ -162,7 +162,8 @@ fn handle_main_events_cleared(
.swap_buffers() .swap_buffers()
.expect("Failed to swap window buffers!"); .expect("Failed to swap window buffers!");
drop(guard); drop(guard);
tracing::trace!(tracy.frame_mark = true); #[cfg(feature = "tracy")]
common::util::tracy_client::finish_continuous_frame!();
} }
if !exit { if !exit {