Skip to content

Commit 82a7ec7

Browse files
committed
add some tracing
1 parent c932d53 commit 82a7ec7

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

ext/mysqlnd/mysqlnd.c

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,6 +1225,7 @@ MYSQLND_METHOD(mysqlnd_conn_data, reap_query)(MYSQLND_CONN_DATA * conn TSRMLS_DC
12251225

12261226
#include "php_network.h"
12271227

1228+
/* {{{ mysqlnd_stream_array_to_fd_set */
12281229
MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS_DC)
12291230
{
12301231
int cnt = 0;
@@ -1255,15 +1256,17 @@ MYSQLND ** mysqlnd_stream_array_check_for_readiness(MYSQLND ** conn_array TSRMLS
12551256
}
12561257
return ret;
12571258
}
1259+
/* }}} */
12581260

12591261

1260-
/* {{{ stream_select mysqlnd_stream_array_to_fd_set functions */
1262+
/* {{{ mysqlnd_stream_array_to_fd_set */
12611263
static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, php_socket_t * max_fd TSRMLS_DC)
12621264
{
12631265
php_socket_t this_fd;
12641266
php_stream *stream = NULL;
1265-
int cnt = 0;
1267+
unsigned int cnt = 0;
12661268
MYSQLND **p = conn_array;
1269+
DBG_ENTER("mysqlnd_stream_array_to_fd_set");
12671270

12681271
while (*p) {
12691272
/* get the fd.
@@ -1272,6 +1275,7 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
12721275
* is not displayed.
12731276
* */
12741277
stream = (*p)->data->net->data->m.get_stream((*p)->data->net TSRMLS_CC);
1278+
DBG_INF_FMT("conn=%llu stream=%p", (*p)->data->thread_id, stream);
12751279
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
12761280
(void*)&this_fd, 1) && this_fd >= 0) {
12771281

@@ -1284,21 +1288,24 @@ static int mysqlnd_stream_array_to_fd_set(MYSQLND ** conn_array, fd_set * fds, p
12841288
}
12851289
p++;
12861290
}
1287-
return cnt ? 1 : 0;
1291+
DBG_RETURN(cnt ? 1 : 0);
12881292
}
1293+
/* }}} */
1294+
12891295

1296+
/* {{{ mysqlnd_stream_array_from_fd_set */
12901297
static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds TSRMLS_DC)
12911298
{
12921299
php_socket_t this_fd;
12931300
php_stream *stream = NULL;
12941301
int ret = 0;
12951302
zend_bool disproportion = FALSE;
1296-
1297-
12981303
MYSQLND **fwd = conn_array, **bckwd = conn_array;
1304+
DBG_ENTER("mysqlnd_stream_array_from_fd_set");
12991305

13001306
while (*fwd) {
13011307
stream = (*fwd)->data->net->data->m.get_stream((*fwd)->data->net TSRMLS_CC);
1308+
DBG_INF_FMT("conn=%llu stream=%p", (*fwd)->data->thread_id, stream);
13021309
if (stream != NULL && SUCCESS == php_stream_cast(stream, PHP_STREAM_AS_FD_FOR_SELECT | PHP_STREAM_CAST_INTERNAL,
13031310
(void*)&this_fd, 1) && this_fd >= 0) {
13041311
if (PHP_SAFE_FD_ISSET(this_fd, fds)) {
@@ -1316,7 +1323,7 @@ static int mysqlnd_stream_array_from_fd_set(MYSQLND ** conn_array, fd_set * fds
13161323
}
13171324
*bckwd = NULL;/* NULL-terminate the list */
13181325

1319-
return ret;
1326+
DBG_RETURN(ret);
13201327
}
13211328
/* }}} */
13221329

0 commit comments

Comments
 (0)