Signed-off-by: Andrea Righi <email address hidden>
1. Build a kernel image with 'zfs_enable' flag set as false.
2. Build SPL/ZFS modules independently by make command (debug purpose; DECLARE_EVENT_CLASS() enabled).
But 'make' was always failed at the same point, 'zfs/module/zfs/trace.c' (as seem as below).
In file included from /home/np/linux-4.15/include/trace/define_trace.h:96:0, from /home/np/linux-4.15/zfs/include/sys/trace_dmu.h:127, from /home/np/linux-4.15/zfs/module/zfs/trace.c:45:
/home/np/linux-4.15/zfs/include/sys/trace_dmu.h: In function ‘trace_event_raw_event_zfs_delay_mintime_class’:
/home/np/linux-4.15/zfs/include/sys/trace_dmu.h:65:37: error: ‘dmu_tx_t {aka struct dmu_tx}’ has no member named ‘tx_dirty_delayed’
__entry->tx_dirty_delayed = tx->tx_dirty_delayed; ^
/home/np/linux-4.15/include/trace/trace_events.h:719:4: note: in definition of macro ‘DECLARE_EVENT_CLASS’
{ assign; } \
^~~~~~
/home/np/linux-4.15/zfs/include/sys/trace_dmu.h:60:2: note: in expansion of macro ‘TP_fast_assign’
TP_fast_assign(
^~~~~~~~~~~~~~
In file included from /home/np/linux-4.15/include/trace/define_trace.h:97:0, from /home/np/linux-4.15/zfs/include/sys/trace_dmu.h:127, from /home/np/linux-4.15/zfs/module/zfs/trace.c:45:
/home/np/linux-4.15/zfs/include/sys/trace_dmu.h: In function ‘perf_trace_zfs_delay_mintime_class’:
/home/np/linux-4.15/zfs/include/sys/trace_dmu.h:65:37: error: ‘dmu_tx_t {aka struct dmu_tx}’ has no member named ‘tx_dirty_delayed’
__entry->tx_dirty_delayed = tx->tx_dirty_delayed; ^
/home/np/linux-4.15/include/trace/perf.h:66:4: note: in definition of macro ‘DECLARE_EVENT_CLASS’
{ assign; } \
^~~~~~
/home/np/linux-4.15/zfs/include/sys/trace_dmu.h:60:2: note: in expansion of macro ‘TP_fast_assign’
TP_fast_assign(
^~~~~~~~~~~~~~
I tried to debug this issue with myself, and found something intriguing.
In 'zfs/include/sys/trace_dmu.h', the failed code accessing 'tx_dirty_delayed' from 'dmu_tx_t' (which same as 'struct dmu_tx').
But, implementation of 'strcut dmu_tx' doesn't contain 'tx_dirty_delayed' (in zfs/include/sys/dmu_tx.h)
struct dmu_tx {
/*
* No synchronization is needed because a tx can only be handled
* by one thread.
*/
list_t tx_holds; /* list of dmu_tx_hold_t */
objset_t *tx_objset;
struct dsl_dir *tx_dir;
struct dsl_pool *tx_pool;
uint64_t tx_txg;
uint64_t tx_lastsnap_txg;
uint64_t tx_lasttried_txg; txg_handle_t tx_txgh;
void *tx_tempreserve_cookie;
struct dmu_tx_hold *tx_needassign_txh;
/* list of dmu_tx_callback_t on this dmu_tx */
list_t tx_callbacks;
/* placeholder for syncing context, doesn't need specific holds */
boolean_t tx_anyobj;
/* has this transaction already been delayed? */
boolean_t tx_waited;
/* transaction is marked as being a "net free" of space */
boolean_t tx_netfree;
/* time this transaction was created */
hrtime_t tx_start;
/* need to wait for sufficient dirty space */
boolean_t tx_wait_dirty;
int tx_err;
};
Looks above, current in-source-tree ZFS module seems not valid... :(
Is there are walkaround for this problem?
I tried to build a kernel 4.15.0-48.51 that cloned from the Ubuntu kernel git (x86_64-generic flavour).
commit c50532b9d7b623f f98aeaf0b848e58 adae54ca75 (HEAD -> master, tag: Ubuntu- 4.15.0- 48.51, origin/master, origin/HEAD)
Author: Andrea Righi <email address hidden>
Date: Tue Apr 2 18:31:55 2019 +0200
UBUNTU: Ubuntu-4.15.0-48.51
Signed-off-by: Andrea Righi <email address hidden>
1. Build a kernel image with 'zfs_enable' flag set as false. EVENT_CLASS( ) enabled).
2. Build SPL/ZFS modules independently by make command (debug purpose; DECLARE_
But 'make' was always failed at the same point, 'zfs/module/ zfs/trace. c' (as seem as below).
In file included from /home/np/ linux-4. 15/include/ trace/define_ trace.h: 96:0,
from /home/np/ linux-4. 15/zfs/ include/ sys/trace_ dmu.h:127,
from /home/np/ linux-4. 15/zfs/ module/ zfs/trace. c:45: linux-4. 15/zfs/ include/ sys/trace_ dmu.h: In function ‘trace_ event_raw_ event_zfs_ delay_mintime_ class’: linux-4. 15/zfs/ include/ sys/trace_ dmu.h:65: 37: error: ‘dmu_tx_t {aka struct dmu_tx}’ has no member named ‘tx_dirty_delayed’ _entry- >tx_dirty_ delayed = tx->tx_ dirty_delayed;
^ linux-4. 15/include/ trace/trace_ events. h:719:4: note: in definition of macro ‘DECLARE_ EVENT_CLASS’ linux-4. 15/zfs/ include/ sys/trace_ dmu.h:60: 2: note: in expansion of macro ‘TP_fast_assign’ linux-4. 15/include/ trace/define_ trace.h: 97:0,
from /home/np/ linux-4. 15/zfs/ include/ sys/trace_ dmu.h:127,
from /home/np/ linux-4. 15/zfs/ module/ zfs/trace. c:45: linux-4. 15/zfs/ include/ sys/trace_ dmu.h: In function ‘perf_trace_ zfs_delay_ mintime_ class’: linux-4. 15/zfs/ include/ sys/trace_ dmu.h:65: 37: error: ‘dmu_tx_t {aka struct dmu_tx}’ has no member named ‘tx_dirty_delayed’ _entry- >tx_dirty_ delayed = tx->tx_ dirty_delayed;
^ linux-4. 15/include/ trace/perf. h:66:4: note: in definition of macro ‘DECLARE_ EVENT_CLASS’ linux-4. 15/zfs/ include/ sys/trace_ dmu.h:60: 2: note: in expansion of macro ‘TP_fast_assign’
/home/np/
/home/np/
_
/home/np/
{ assign; } \
^~~~~~
/home/np/
TP_fast_assign(
^~~~~~~~~~~~~~
In file included from /home/np/
/home/np/
/home/np/
_
/home/np/
{ assign; } \
^~~~~~
/home/np/
TP_fast_assign(
^~~~~~~~~~~~~~
I tried to debug this issue with myself, and found something intriguing. sys/trace_ dmu.h', the failed code accessing 'tx_dirty_delayed' from 'dmu_tx_t' (which same as 'struct dmu_tx').
In 'zfs/include/
DECLARE_ EVENT_CLASS( zfs_delay_ mintime_ class,
TP_PROTO( dmu_tx_ t *tx, uint64_t dirty, uint64_t min_tx_time),
TP_STRUCT_ _entry(
__ field(uint64_ t, tx_txg)
__ field(uint64_ t, tx_lastsnap_txg)
__ field(uint64_ t, tx_lasttried_txg)
__ field(boolean_ t, tx_anyobj)
__ field(boolean_ t, tx_dirty_delayed)
__ field(hrtime_ t, tx_start)
__ field(boolean_ t, tx_wait_dirty)
__ field(int, tx_err)
__ field(uint64_ t, min_tx_time)
__ field(uint64_ t, dirty)
TP_fast_ assign(
__ entry-> tx_txg = tx->tx_txg;
__ entry-> tx_lastsnap_ txg = tx->tx_ lastsnap_ txg;
__ entry-> tx_lasttried_ txg = tx->tx_ lasttried_ txg;
__ entry-> tx_anyobj = tx->tx_anyobj;
__ entry-> tx_dirty_ delayed = tx->tx_ dirty_delayed;
__ entry-> tx_start = tx->tx_start;
__ entry-> tx_wait_ dirty = tx->tx_wait_dirty;
__ entry-> tx_err = tx->tx_err;
__ entry-> dirty = dirty;
__ entry-> min_tx_ time = min_tx_time;
TP_printk( "tx { txg %llu lastsnap_txg %llu tx_lasttried_txg %llu "
__ entry-> tx_txg, __entry- >tx_lastsnap_ txg,
__ entry-> tx_lasttried_ txg, __entry->tx_anyobj,
__ entry-> tx_dirty_ delayed, __entry->tx_start,
__ entry-> tx_wait_ dirty, __entry->tx_err,
__ entry-> dirty, __entry- >min_tx_ time)
TP_ARGS(tx, dirty, min_tx_time),
),
),
"anyobj %d dirty_delayed %d start %llu wait_dirty %d err %i "
"} dirty %llu min_tx_time %llu",
);
But, implementation of 'strcut dmu_tx' doesn't contain 'tx_dirty_delayed' (in zfs/include/ sys/dmu_ tx.h)
struct dmu_tx {
txg_handle_ t tx_txgh; _cookie;
/*
* No synchronization is needed because a tx can only be handled
* by one thread.
*/
list_t tx_holds; /* list of dmu_tx_hold_t */
objset_t *tx_objset;
struct dsl_dir *tx_dir;
struct dsl_pool *tx_pool;
uint64_t tx_txg;
uint64_t tx_lastsnap_txg;
uint64_t tx_lasttried_txg;
void *tx_tempreserve
struct dmu_tx_hold *tx_needassign_txh;
/* list of dmu_tx_callback_t on this dmu_tx */
list_t tx_callbacks;
/* placeholder for syncing context, doesn't need specific holds */
boolean_t tx_anyobj;
/* has this transaction already been delayed? */
boolean_t tx_waited;
/* transaction is marked as being a "net free" of space */
boolean_t tx_netfree;
/* time this transaction was created */
hrtime_t tx_start;
/* need to wait for sufficient dirty space */
boolean_t tx_wait_dirty;
int tx_err;
};
Looks above, current in-source-tree ZFS module seems not valid... :(
Is there are walkaround for this problem?