/* General debugging messages */ #define dbg_gen(fmt, ...) ubi_dbg_msg("gen", fmt, ##__VA_ARGS__) /* Messages from the eraseblock association sub-system */ #define dbg_eba(fmt, ...) ubi_dbg_msg("eba", fmt, ##__VA_ARGS__) /* Messages from the wear-leveling sub-system */ #define dbg_wl(fmt, ...) ubi_dbg_msg("wl", fmt, ##__VA_ARGS__) /* Messages from the input/output sub-system */ #define dbg_io(fmt, ...) ubi_dbg_msg("io", fmt, ##__VA_ARGS__) /* Initialization and build messages */ #define dbg_bld(fmt, ...) ubi_dbg_msg("bld", fmt, ##__VA_ARGS__)
void ubi_dump_vol_info(conststruct ubi_volume *vol); void ubi_dump_vtbl_record(conststruct ubi_vtbl_record *r, int idx); void ubi_dump_av(conststruct ubi_ainf_volume *av); void ubi_dump_aeb(conststruct ubi_ainf_peb *aeb, int type); void ubi_dump_mkvol_req(conststruct ubi_mkvol_req *req); int ubi_self_check_all_ff(struct ubi_device *ubi, int pnum, int offset, int len); int ubi_debugfs_init(void); void ubi_debugfs_exit(void); int ubi_debugfs_init_dev(struct ubi_device *ubi); void ubi_debugfs_exit_dev(struct ubi_device *ubi);
/** * The following function is a legacy implementation of UBI fault-injection * hook. When using more powerful fault injection capabilities, the legacy * fault injection interface should be retained.
*/ int ubi_dbg_power_cut(struct ubi_device *ubi, int caller);
#define ubi_dbg_fail_bitflip(u) false #define ubi_dbg_fail_write(u) false #define ubi_dbg_fail_erase(u) false #define ubi_dbg_fail_power_cut(u, c) false #define ubi_dbg_fail_read(u, c) false #define ubi_dbg_fail_eccerr(u) false #define ubi_dbg_fail_ff(u, c) false #define ubi_dbg_fail_ff_bitflips(u, v) false #define ubi_dbg_fail_bad_hdr(u, c) false #define ubi_dbg_fail_bad_hdr_ebadmsg(u, c) false
#endif
/** * ubi_dbg_is_power_cut - if it is time to emulate power cut. * @ubi: UBI device description object * * Returns true if power cut should be emulated, otherwise returns false.
*/ staticinlinebool ubi_dbg_is_power_cut(struct ubi_device *ubi, unsignedint caller)
{ if (ubi_dbg_power_cut(ubi, caller)) returntrue; return ubi_dbg_fail_power_cut(ubi, caller);
}
/** * ubi_dbg_is_bitflip - if it is time to emulate a bit-flip. * @ubi: UBI device description object * * Returns true if a bit-flip should be emulated, otherwise returns false.
*/ staticinlinebool ubi_dbg_is_bitflip(conststruct ubi_device *ubi)
{ if (ubi_dbg_bitflip(ubi)) returntrue; return ubi_dbg_fail_bitflip(ubi);
}
/** * ubi_dbg_is_write_failure - if it is time to emulate a write failure. * @ubi: UBI device description object * * Returns true if a write failure should be emulated, otherwise returns * false.
*/ staticinlinebool ubi_dbg_is_write_failure(conststruct ubi_device *ubi)
{ if (ubi_dbg_write_failure(ubi)) returntrue; return ubi_dbg_fail_write(ubi);
}
/** * ubi_dbg_is_erase_failure - if its time to emulate an erase failure. * @ubi: UBI device description object * * Returns true if an erase failure should be emulated, otherwise returns * false.
*/ staticinlinebool ubi_dbg_is_erase_failure(conststruct ubi_device *ubi)
{ if (ubi_dbg_erase_failure(ubi)) returntrue; return ubi_dbg_fail_erase(ubi);
}
/** * ubi_dbg_is_eccerr - if it is time to emulate ECC error. * @ubi: UBI device description object * * Returns true if a ECC error should be emulated, otherwise returns false.
*/ staticinlinebool ubi_dbg_is_eccerr(conststruct ubi_device *ubi)
{ return ubi_dbg_fail_eccerr(ubi);
}
/** * ubi_dbg_is_read_failure - if it is time to emulate a read failure. * @ubi: UBI device description object * * Returns true if a read failure should be emulated, otherwise returns * false.
*/ staticinlinebool ubi_dbg_is_read_failure(conststruct ubi_device *ubi, unsignedint caller)
{ return ubi_dbg_fail_read(ubi, caller);
}
/** * ubi_dbg_is_ff - if it is time to emulate that read region is only 0xFF. * @ubi: UBI device description object * * Returns true if read region should be emulated 0xFF, otherwise * returns false.
*/ staticinlinebool ubi_dbg_is_ff(conststruct ubi_device *ubi, unsignedint caller)
{ return ubi_dbg_fail_ff(ubi, caller);
}
/** * ubi_dbg_is_ff_bitflips - if it is time to emulate that read region is only 0xFF * with error reported by the MTD driver * * @ubi: UBI device description object * * Returns true if read region should be emulated 0xFF and error * reported by the MTD driver, otherwise returns false.
*/ staticinlinebool ubi_dbg_is_ff_bitflips(conststruct ubi_device *ubi, unsignedint caller)
{ return ubi_dbg_fail_ff_bitflips(ubi, caller);
}
/** * ubi_dbg_is_bad_hdr - if it is time to emulate a bad header * @ubi: UBI device description object * * Returns true if a bad header error should be emulated, otherwise * returns false.
*/ staticinlinebool ubi_dbg_is_bad_hdr(conststruct ubi_device *ubi, unsignedint caller)
{ return ubi_dbg_fail_bad_hdr(ubi, caller);
}
/** * ubi_dbg_is_bad_hdr_ebadmsg - if it is time to emulate a bad header with * ECC error. * * @ubi: UBI device description object * * Returns true if a bad header with ECC error should be emulated, otherwise * returns false.
*/ staticinlinebool ubi_dbg_is_bad_hdr_ebadmsg(conststruct ubi_device *ubi, unsignedint caller)
{ return ubi_dbg_fail_bad_hdr_ebadmsg(ubi, caller);
}
/** * ubi_dbg_is_bgt_disabled - if the background thread is disabled. * @ubi: UBI device description object * * Returns non-zero if the UBI background thread is disabled for testing * purposes.
*/ staticinlineint ubi_dbg_is_bgt_disabled(conststruct ubi_device *ubi)
{ return ubi->dbg.disable_bgt;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.