Skip to content

Commit 44e282b

Browse files
cleanup
1 parent bc4daad commit 44e282b

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

profiling/src/timeline.rs

+17-16
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use crate::zend::{
44
InternalFunctionHandler,
55
};
66
use crate::REQUEST_LOCALS;
7+
use ddcommon::cstr;
78
use libc::c_char;
89
use log::{error, trace};
910
#[cfg(php_zts)]
@@ -193,54 +194,54 @@ pub fn timeline_minit() {
193194
pub unsafe fn timeline_startup() {
194195
let handlers = [
195196
zend::datadog_php_zif_handler::new(
196-
CStr::from_bytes_with_nul_unchecked(b"sleep\0"),
197+
cstr!("sleep"),
197198
ptr::addr_of_mut!(SLEEP_HANDLER),
198199
Some(ddog_php_prof_sleep),
199200
),
200201
zend::datadog_php_zif_handler::new(
201-
CStr::from_bytes_with_nul_unchecked(b"usleep\0"),
202+
cstr!("usleep"),
202203
ptr::addr_of_mut!(USLEEP_HANDLER),
203204
Some(ddog_php_prof_usleep),
204205
),
205206
zend::datadog_php_zif_handler::new(
206-
CStr::from_bytes_with_nul_unchecked(b"time_nanosleep\0"),
207+
cstr!("time_nanosleep"),
207208
ptr::addr_of_mut!(TIME_NANOSLEEP_HANDLER),
208209
Some(ddog_php_prof_time_nanosleep),
209210
),
210211
zend::datadog_php_zif_handler::new(
211-
CStr::from_bytes_with_nul_unchecked(b"time_sleep_until\0"),
212+
cstr!("time_sleep_until"),
212213
ptr::addr_of_mut!(TIME_SLEEP_UNTIL_HANDLER),
213214
Some(ddog_php_prof_time_sleep_until),
214215
),
215216
zend::datadog_php_zif_handler::new(
216-
CStr::from_bytes_with_nul_unchecked(b"frankenphp_handle_request\0"),
217+
cstr!("frankenphp_handle_request"),
217218
ptr::addr_of_mut!(FRANKENPHP_HANDLE_REQUEST_HANDLER),
218219
Some(ddog_php_prof_frankenphp_handle_request),
219220
),
220221
zend::datadog_php_zif_handler::new(
221-
CStr::from_bytes_with_nul_unchecked(b"stream_select\0"),
222+
cstr!("stream_select"),
222223
ptr::addr_of_mut!(STREAM_SELECT_HANDLER),
223224
Some(ddog_php_prof_stream_select),
224225
),
225226
zend::datadog_php_zif_handler::new(
226-
CStr::from_bytes_with_nul_unchecked(b"socket_select\0"),
227+
cstr!("socket_select"),
227228
ptr::addr_of_mut!(SOCKET_SELECT_HANDLER),
228229
Some(ddog_php_prof_socket_select),
229230
),
230231
zend::datadog_php_zif_handler::new(
231-
CStr::from_bytes_with_nul_unchecked(b"curl_multi_select\0"),
232+
cstr!("curl_multi_select"),
232233
ptr::addr_of_mut!(CURL_MULTI_SELECT_HANDLER),
233234
Some(ddog_php_prof_curl_multi_select),
234235
),
235236
// provided by `ext-uv` from https://pecl.php.net/package/uv
236237
zend::datadog_php_zif_handler::new(
237-
CStr::from_bytes_with_nul_unchecked(b"uv_run\0"),
238+
cstr!("uv_run"),
238239
ptr::addr_of_mut!(UV_RUN_HANDLER),
239240
Some(ddog_php_prof_uv_run),
240241
),
241242
// provided by `ext-libevent` from https://pecl.php.net/package/libevent
242243
zend::datadog_php_zif_handler::new(
243-
CStr::from_bytes_with_nul_unchecked(b"event_base_loop\0"),
244+
cstr!("event_base_loop"),
244245
ptr::addr_of_mut!(EVENT_BASE_LOOP_HANDLER),
245246
Some(ddog_php_prof_event_base_loop),
246247
),
@@ -254,22 +255,22 @@ pub unsafe fn timeline_startup() {
254255
let handlers = [
255256
// provided by `ext-ev` from https://pecl.php.net/package/ev
256257
zend::datadog_php_zim_handler::new(
257-
CStr::from_bytes_with_nul_unchecked(b"evloop\0"),
258-
CStr::from_bytes_with_nul_unchecked(b"run\0"),
258+
cstr!("evloop"),
259+
cstr!("run"),
259260
ptr::addr_of_mut!(EV_LOOP_RUN_HANDLER),
260261
Some(ddog_php_prof_ev_loop_run),
261262
),
262263
// provided by `ext-event` from https://pecl.php.net/package/event
263264
zend::datadog_php_zim_handler::new(
264-
CStr::from_bytes_with_nul_unchecked(b"eventbase\0"),
265-
CStr::from_bytes_with_nul_unchecked(b"loop\0"),
265+
cstr!("eventbase"),
266+
cstr!("loop"),
266267
ptr::addr_of_mut!(EVENTBASE_LOOP_HANDLER),
267268
Some(ddog_php_prof_eventbase_loop),
268269
),
269270
// provided by `ext-parallel` from https://pecl.php.net/package/parallel
270271
zend::datadog_php_zim_handler::new(
271-
CStr::from_bytes_with_nul_unchecked(b"parallel\\events\0"),
272-
CStr::from_bytes_with_nul_unchecked(b"poll\0"),
272+
cstr!("parallel\\events"),
273+
cstr!("poll"),
273274
ptr::addr_of_mut!(PARALLEL_EVENTS_POLL_HANDLER),
274275
Some(ddog_php_prof_parallel_events_poll),
275276
),

0 commit comments

Comments
 (0)