Skip to content

Commit

Permalink
move trace-dump into trace (xi-editor#1156)
Browse files Browse the repository at this point in the history
* move trace-dump into trace

* run rustfmt
  • Loading branch information
bzm3r authored and cmyr committed Mar 31, 2019
1 parent 71930c4 commit 533a66a
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 155 deletions.
3 changes: 3 additions & 0 deletions rust/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
*.rs.bk
target
build

# Editor configs
.idea/
16 changes: 3 additions & 13 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ members = [
"sample-plugin",
"syntect-plugin",
"trace",
"trace-dump",
"unicode",
]

Expand Down
1 change: 0 additions & 1 deletion rust/core-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ regex = "1.0"
memchr = "2.0.1"

xi-trace = { path = "../trace", version = "0.1.0" }
xi-trace-dump = { path = "../trace-dump", version = "0.1.0" }
xi-rope = { path = "../rope", version = "0.3" }
xi-unicode = { path = "../unicode", version = "0.1.0" }
xi-rpc = { path = "../rpc", version = "0.2.0" }
Expand Down
1 change: 0 additions & 1 deletion rust/core-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ extern crate toml;
extern crate xi_rope;
extern crate xi_rpc;
extern crate xi_trace;
extern crate xi_trace_dump;
extern crate xi_unicode;

#[cfg(feature = "ledger")]
Expand Down
8 changes: 4 additions & 4 deletions rust/core-lib/src/tabs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -864,16 +864,16 @@ impl CoreState {
where
P: AsRef<Path>,
{
use xi_trace_dump::*;
use xi_trace::chrome_trace_dump;
let mut all_traces = xi_trace::samples_cloned_unsorted();
if let Ok(mut traces) = chrome_trace::decode(frontend_samples) {
if let Ok(mut traces) = chrome_trace_dump::decode(frontend_samples) {
all_traces.append(&mut traces);
}

for plugin in &self.running_plugins {
match plugin.collect_trace() {
Ok(json) => {
let mut trace = chrome_trace::decode(json).unwrap();
let mut trace = chrome_trace_dump::decode(json).unwrap();
all_traces.append(&mut trace);
}
Err(e) => error!("trace error {:?}", e),
Expand All @@ -890,7 +890,7 @@ impl CoreState {
}
};

if let Err(e) = chrome_trace::serialize(&all_traces, &mut trace_file) {
if let Err(e) = chrome_trace_dump::serialize(&all_traces, &mut trace_file) {
error!("error saving trace {:?}", e);
}
}
Expand Down
3 changes: 0 additions & 3 deletions rust/plugin-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ log = "0.4.3"
[dependencies.xi-trace]
path = "../trace"

[dependencies.xi-trace-dump]
path = "../trace-dump"

[dependencies.xi-rpc]
path = "../rpc"

Expand Down
4 changes: 2 additions & 2 deletions rust/plugin-lib/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ impl<'a, P: 'a + Plugin> Dispatcher<'a, P> {
}

fn do_collect_trace(&self) -> Result<Value, RemoteError> {
use xi_trace_dump::*;
use xi_trace::chrome_trace_dump;

let samples = xi_trace::samples_cloned_unsorted();
chrome_trace::to_value(&samples).map_err(|e| RemoteError::Custom {
chrome_trace_dump::to_value(&samples).map_err(|e| RemoteError::Custom {
code: 0,
message: format!("Could not serialize trace: {:?}", e),
data: None,
Expand Down
1 change: 0 additions & 1 deletion rust/plugin-lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ extern crate xi_core_lib as xi_core;
extern crate xi_rope;
extern crate xi_rpc;
extern crate xi_trace;
extern crate xi_trace_dump;
#[macro_use]
extern crate serde_json;
extern crate bytecount;
Expand Down
27 changes: 0 additions & 27 deletions rust/trace-dump/Cargo.toml

This file was deleted.

71 changes: 0 additions & 71 deletions rust/trace-dump/src/chrome_trace.rs

This file was deleted.

5 changes: 4 additions & 1 deletion rust/trace/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ edition = '2018'
[features]
benchmarks = []
collections_range = []
default = []
default = ["chrome_trace_event"]
dict_payload = []
json_payload = ["serde_json"]
getpid = []
chrome_trace_event = ["serde_json"]
ipc = ["bincode"]

[dependencies]
time = "0.1"
Expand All @@ -24,3 +26,4 @@ serde_derive = "1.0"
serde = "1.0"
libc = "0.2"
log = "0.4.3"
bincode = { version = "1.0", optional = true }
Loading

0 comments on commit 533a66a

Please sign in to comment.