Skip to content

Commit 4af52ca

Browse files
authored
rust-sdk: rename crates for publishing on crates.io (#3513)
`perfetto*` are unfortunatly taken by empty crates. This adds a `-sdk` suffix to the name in order make the crate names unique. Issue: #3446
1 parent 3907cf1 commit 4af52ca

File tree

23 files changed

+40
-39
lines changed

23 files changed

+40
-39
lines changed

contrib/rust-sdk/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ This workspace consists of three crates:
1616

1717
| Crate | Description |
1818
|-------|--------------|
19-
| [`perfetto-sys`](./perfetto-sys) | Low-level FFI bindings to the C API (`perfetto_c`). Can link against system or vendored builds. |
20-
| [`perfetto`](./perfetto) | Safe and ergonomic wrapper around the raw FFI. Exposes the tracing session, data source, and track event APIs. |
21-
| [`perfetto-derive`](./perfetto-derive) | Procedural macros for tracing the scope of function calls and automatically capturing all input parameters. |
19+
| [`perfetto-sdk-sys`](./perfetto-sys) | Low-level FFI bindings to the C API (`perfetto_c`). Can link against system or vendored builds. |
20+
| [`perfetto-sdk`](./perfetto) | Safe and ergonomic wrapper around the raw FFI. Exposes the tracing session, data source, and track event APIs. |
21+
| [`perfetto-sdk-derive`](./perfetto-derive) | Procedural macros for tracing the scope of function calls and automatically capturing all input parameters. |
22+
| [`perfetto-sdk-protos-gpu`](./perfetto-protos-gpu) | Extra protobuf bindings for GPU events. |
2223

2324
---
2425

contrib/rust-sdk/perfetto-derive/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
edition = "2024"
3-
name = "perfetto-derive"
3+
name = "perfetto-sdk-derive"
44
version = "0.1.0"
55
authors = ["David Reveman <[email protected]>"]
66
description = "Procedural macros for Perfetto"
@@ -18,10 +18,10 @@ proc-macro = true
1818

1919
[features]
2020
default = ["vendored"]
21-
vendored = ["perfetto/vendored"]
21+
vendored = ["perfetto-sdk/vendored"]
2222

2323
[dependencies]
24-
perfetto = { path = "../perfetto", version = "0.1.0", default-features = false }
24+
perfetto-sdk = { path = "../perfetto", version = "0.1.0", default-features = false }
2525
syn = { version = "2", features = ["full"] }
2626
quote = "1.0.8"
2727
proc-macro2 = "1.0"

contrib/rust-sdk/perfetto-derive/examples/derive.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use perfetto::{producer::*, track_event::TrackEvent, track_event_categories};
16-
use perfetto_derive::tracefn;
15+
use perfetto_sdk::{producer::*, track_event::TrackEvent, track_event_categories};
16+
use perfetto_sdk_derive::tracefn;
1717
use std::error::Error;
1818

1919
track_event_categories! {

contrib/rust-sdk/perfetto-derive/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl MacroArgs {
9393
/// Example:
9494
///
9595
/// ```
96-
/// use perfetto::*;
96+
/// use perfetto_sdk::*;
9797
///
9898
/// track_event_categories! {
9999
/// pub mod my_derive_te_ns {
@@ -103,7 +103,7 @@ impl MacroArgs {
103103
///
104104
/// use my_derive_te_ns as perfetto_te_ns;
105105
///
106-
/// use perfetto_derive::tracefn;
106+
/// use perfetto_sdk_derive::tracefn;
107107
///
108108
/// #[tracefn("c1")]
109109
/// fn atoi(string_arg: String) -> Result<i32, std::num::ParseIntError> {
@@ -166,7 +166,7 @@ pub fn tracefn(
166166
let result = quote! {
167167
#( #fn_attrs )*
168168
#fn_vis #fn_abi fn #fn_name(#fn_args) #fn_output {
169-
use perfetto::track_event::*;
169+
use perfetto_sdk::track_event::*;
170170
use std::os::raw::c_char;
171171
const CATEGORY_INDEX: usize = perfetto_te_ns::category_index(#category);
172172
let is_category_enabled = perfetto_te_ns::is_category_enabled(CATEGORY_INDEX);

contrib/rust-sdk/perfetto-protos-gpu/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
edition = "2024"
3-
name = "perfetto-protos-gpu"
3+
name = "perfetto-sdk-protos-gpu"
44
version = "0.1.0"
55
authors = ["David Reveman <[email protected]>"]
66
description = "Extra protobuf bindings for GPU events"
@@ -14,7 +14,7 @@ license = "Apache-2.0"
1414
repository = "https://github.com/google/perfetto"
1515

1616
[dependencies]
17-
perfetto = { path = "../perfetto", version = "0.1.0", default-features = false }
17+
perfetto-sdk = { path = "../perfetto", version = "0.1.0", default-features = false }
1818
paste = "1"
1919

2020
[[example]]

contrib/rust-sdk/perfetto-protos-gpu/examples/gpu_counters.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
use perfetto::{
15+
use perfetto_sdk::{
1616
data_source::*, pb_decoder::*, producer::*, protos::trace::trace_packet::TracePacket,
1717
};
1818

19-
use perfetto_protos_gpu::protos::{
19+
use perfetto_sdk_protos_gpu::protos::{
2020
common::gpu_counter_descriptor::*, config::data_source_config::*,
2121
config::gpu::gpu_counter_config::*, trace::gpu::gpu_counter_event::*,
2222
trace::trace_packet::prelude::*,

contrib/rust-sdk/perfetto-protos-gpu/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
// limitations under the License.
1414

1515
/// Re-export pb_msg macro from this crate.
16-
pub use perfetto::pb_msg;
16+
pub use perfetto_sdk::pb_msg;
1717

1818
/// Re-export pb_msg_ext macro from this crate.
19-
pub use perfetto::pb_msg_ext;
19+
pub use perfetto_sdk::pb_msg_ext;
2020

2121
/// Re-export pb_enum macro from this crate.
22-
pub use perfetto::pb_enum;
22+
pub use perfetto_sdk::pb_enum;
2323

2424
/// Protobuf bindings module.
2525
pub mod protos;

contrib/rust-sdk/perfetto-protos-gpu/src/protos/common/data_source_descriptor.pz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use crate::pb_msg;
1919
use crate::pb_msg_ext;
2020
use crate::protos::common::gpu_counter_descriptor::*;
2121

22-
use perfetto::protos::common::data_source_descriptor::DataSourceDescriptor;
22+
use perfetto_sdk::protos::common::data_source_descriptor::DataSourceDescriptor;
2323

2424
pb_msg_ext!(DataSourceDescriptor {
2525
gpu_counter_descriptor: GpuCounterDescriptor, msg, 5,

contrib/rust-sdk/perfetto-protos-gpu/src/protos/config/data_source_config.pz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::protos::config::gpu::gpu_counter_config::*;
2121
use crate::protos::config::gpu::gpu_renderstages_config::*;
2222
use crate::protos::config::gpu::vulkan_memory_config::*;
2323

24-
use perfetto::protos::config::data_source_config::DataSourceConfig;
24+
use perfetto_sdk::protos::config::data_source_config::DataSourceConfig;
2525

2626
pb_msg_ext!(DataSourceConfig {
2727
gpu_counter_config: GpuCounterConfig, msg, 108,

contrib/rust-sdk/perfetto-protos-gpu/src/protos/trace/interned_data/interned_data.pz.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ use crate::pb_msg;
1818
use crate::pb_msg_ext;
1919
use crate::protos::trace::gpu::gpu_render_stage_event::*;
2020

21-
use perfetto::protos::trace::interned_data::interned_data::InternedData;
22-
use perfetto::protos::trace::profiling::profile_common::InternedString;
21+
use perfetto_sdk::protos::trace::interned_data::interned_data::InternedData;
22+
use perfetto_sdk::protos::trace::profiling::profile_common::InternedString;
2323

2424
pb_msg_ext!(InternedData {
2525
vulkan_memory_keys: InternedString, msg, 22,

0 commit comments

Comments
 (0)