Skip to contentSkip to conversation

megasas: LSI Megaraid SAS HBA emulation

PATCH Superseded Hannes Reinecke 3 participants 5 messages Jan 12, 2012 – Jan 13, 2012 Kbuild

v8 of 17 Superseded Latest is v17 →

lore
Share & tools
lore
#0 lore raw

PATCH v8 1/1 megasas: LSI Megaraid SAS HBA emulation

This patch adds an emulation for the LSI Megaraid SAS 8708EM2 HBA. I've tested it to work with Linux, Windows Vista, and Windows7.

Changes since v7:
- Port to new memory API
- Port to new PCI infrastructure
- Use fixed buffers for sense processing
- Update to updated SCSI infrastructure

Changes since v6:
- Preliminary patches pushed to Kevins block tree
- Implement 64bit contexts, required for Windows7
- Use iovecs for DCMD processing
- Add MSI-X support
Latest Linux driver now happily uses MSI-X.
- Static iovec allocation
We have a fixed upper number of iovecs, so we can save us the allocation. Suggested by Alex Graf.
- Update MFI header
Latest Linux driver has some more definitions, add them
- Fixup AEN handling
- Update tracing details
- Remove sdev pointer from megasas_cmd_t

Changes since v5:
- megasas: Use tracing infrastructure instead of DPRINTF
- megasas: Use new PCI infrastructure
- megasas: Check for iovec mapping failure cpu_map_physical_memory() might fail, so we need to check for it when mapping iovecs.
- megasas: Trace scsi buffer overflow
The transfer length as specified in the SCSI command might disagree with the length of the iovec. We should be tracing these issues.
- megasas: Reset frames after init firmware
When receiving an INIT FIRMWARE command we need reset all frames, otherwise some frames might point to invalid memory.

Chances since v4:
- megasas: checkpatch.pl fixes and update to work with the changed interface in scsi_req_new(). Also included the suggested fixes from Alex.

---
 Makefile.objs           |    1 +
 default-configs/pci.mak |    1 +
 hw/megasas.c            | 2151 +++++++++++++++++++++++++++++++++++++++++++++++
 hw/mfi.h                | 1281 ++++++++++++++++++++++++++++
 hw/pci_ids.h            |    3 +-
 trace-events            |   71 ++
 6 files changed, 3507 insertions(+), 1 deletions(-)
 create mode 100644 hw/megasas.c
 create mode 100644 hw/mfi.h
Makefile.objs +1 -0
index 4f6d26c..3bb2e57 100644
@@ -275,6 +275,7 @@ hw-obj-$(CONFIG_AHCI) += ide/ich.o
 
 # SCSI layer
 hw-obj-$(CONFIG_LSI_SCSI_PCI) += lsi53c895a.o
+hw-obj-$(CONFIG_MEGASAS_SCSI_PCI) += megasas.o
 hw-obj-$(CONFIG_ESP) += esp.o
 
 hw-obj-y += dma-helpers.o sysbus.o isa-bus.o
default-configs/pci.mak +1 -0
index 22bd350..fabb56c 100644
@@ -9,6 +9,7 @@ CONFIG_EEPRO100_PCI=y
 CONFIG_PCNET_PCI=y
 CONFIG_PCNET_COMMON=y
 CONFIG_LSI_SCSI_PCI=y
+CONFIG_MEGASAS_SCSI_PCI=y
 CONFIG_RTL8139_PCI=y
 CONFIG_E1000_PCI=y
 CONFIG_IDE_CORE=y
hw/megasas.c new file +2151 -0

2,151 lines not on this page · raw message

hw/mfi.h new file +1281 -0

835 lines not on this page · raw message

hw/pci_ids.h +2 -1
index 83f3893..73fb46a 100644

Lines of this file are not shown. View the raw message.

trace-events +71 -0

71 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.7.3.4

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 61 lines · Hannes Reinecke
trace-events +61 -0
+# hw/megasas.c
+disable megasas_init_firmware(int xfer_len, uint64_t pa) "xfer len %d pa %" PRIx64 " "
+disable megasas_init_queue(uint64_t queue_pa, int queue_len, uint64_t head, uint64_t tail, uint32_t flags) "queue at %" PRIx64 " len %d head %" PRIx64 " tail %" PRIx64 " flags %x"
+megasas_initq_map_failed(int frame) "scmd %d: failed to map queue"
+megasas_initq_mismatch(int queue_len, int fw_cmds) "queue size %d max fw cmds %d"
+disable megasas_qf_found(unsigned int index, uint64_t pa) "found mapped frame %x pa %" PRIx64 ""
+disable megasas_qf_new(unsigned int index, void *cmd) "return new frame %x cmd %p"
+megasas_qf_failed(unsigned long pa) "all frames busy for frame %lx"
+disable megasas_qf_enqueue(unsigned int index, unsigned int count, uint64_t context, unsigned int tail, int busy) "enqueue frame %x count %d countext %" PRIx64 " tail %x busy %d"
+disable megasas_qf_update(unsigned int head, unsigned int busy) "update reply queue head %x busy %d"
+disable megasas_qf_dequeue(unsigned int index) "dequeue frame %x"
+disable megasas_qf_map_failed(int cmd, unsigned long frame) "scmd %d: frame %lu"
+disable megasas_qf_complete_noirq(uint64_t context) "context %" PRIx64 " "
+disable megasas_qf_complete(uint64_t context, unsigned int tail, unsigned int offset, int busy, unsigned int doorbell) "context %" PRIx64 " tail %x offset %d busy %d doorbell %x"
+disable megasas_handle_frame(const char *cmd, uint64_t addr, uint64_t context, uint32_t count) "MFI cmd %s addr %" PRIx64 " context %" PRIx64 " count %d"
+megasas_frame_busy(uint64_t addr) "frame %" PRIx64 " busy"
+megasas_unhandled_frame_cmd(int cmd, uint8_t frame_cmd) "scmd %d: Unhandled MFI cmd %x"
+disable megasas_handle_scsi(const char *frame, const char *desc, int dev, int lun, void *sdev, unsigned long size) "%s %s dev %x/%x sdev %p xfer %lu"
+disable megasas_scsi_target_not_present(const char *frame, const char *desc, int dev, int lun) "%s %s dev %x/%x target not present"
+megasas_scsi_invalid_cdb_len(const char *frame, const char *desc, int dev, int lun, int len) "%s %s dev %x/%x invalid cdb len %d"
+megasas_scsi_overflow(int cmd, const char *dir, int bytes, int len) "scmd %d: %s %d of %d bytes"
+disable megasas_scsi_underflow(int cmd, const char *dir, int bytes, int len) "scmd %d: %s %d of %d bytes"
+megasas_scsi_req_alloc_failed(const char *frame, int dev, int lun) "%s dev %x/%x req allocation failed"
+disable megasas_scsi_start(int cmd, const char *desc, int len) "scmd %d: %s %d bytes of data"
+disable megasas_scsi_nodata(int cmd) "scmd %d: no data to be transferred"
+disable megasas_scsi_complete(int cmd, uint32_t status, int len, int xfer) "scmd %d: finished with status %x, len %u/%u"
+disable megasas_command_complete(int cmd, uint32_t status) "scmd %d: command completed, status %x"
+disable megasas_handle_io(int cmd, const char *frame, int dev, int lun, unsigned long lba, unsigned long count) "scmd %d: %s dev %x/%x lba %lx count %lu"
+disable megasas_io_target_not_present(int cmd, const char *frame, int dev, int lun) "scmd %d: %s dev %x/%x LUN not present"
+disable megasas_io_start(int cmd, const char *dir, unsigned long lba, unsigned long count, unsigned long len) "scmd %d: %s start LBA %lx %lu blocks (%lu bytes)"
+disable megasas_io_complete(int cmd, uint32_t len) "scmd %d: %d bytes completed"
+disable megasas_io_copy(int cmd, const char *dir, int bytes, int len, unsigned long offset) "scmd %d: %s %d of %d bytes, iov offset %lu"
+disable megasas_io_continue(int cmd, int bytes) "scmd %d: %d bytes left"
+megasas_iovec_map_failed(int cmd, int index, unsigned long iov_size) "scmd %d: iovec %d size %lu"
+megasas_iovec_sgl_overflow(int cmd, int index, int limit) "scmd %d: iovec count %d limit %d"
+megasas_iovec_sgl_underflow(int cmd, int index) "scmd %d: iovec count %d"
+megasas_iovec_sgl_invalid(int cmd, int index, uint64_t pa, uint32_t len) "scmd %d: invalid sgl element %d pa %" PRIx64 " len %u"
+megasas_iovec_len(int cmd, const char *desc, int len, int limit) "scmd %d: iovec %s len %d limit %d"
+disable megasas_handle_dcmd(int cmd, int opcode) "scmd %d: MFI DCMD opcode %x"
+disable megasas_finish_dcmd(int cmd, int size) "scmd %d: MFI DCMD wrote %d bytes"
+megasas_dcmd_req_alloc_failed(int cmd, const char *desc) "scmd %d: %s alloc failed"
+disable megasas_dcmd_internal_submit(int cmd, const char *desc, int dev) "scmd %d: %s to dev %d"
+disable megasas_dcmd_internal_finish(int cmd, int opcode, int lun) "scmd %d: DCMD finish internal cmd %x lun %d"
+megasas_dcmd_internal_invalid(int cmd, int opcode) "scmd %d: Invalid internal DCMD %x"
+megasas_dcmd_unhandled(int cmd, int opcode, int len) "scmd %d: opcode %x, len %d"
+disable megasas_dcmd_zero_sge(int cmd) "scmd %d: zero DCMD sge count"
+megasas_dcmd_invalid_sge(int cmd, int count) "scmd %d: invalid DCMD sge count %d"
+megasas_dcmd_map_failed(int cmd) "scmd %d: Failed to map DCMD buffer"
+megasas_dcmd_invalid_xfer_len(int cmd, const char *dcmd, unsigned long size) "scmd %d: %s invalid xfer len %ld"
+disable megasas_dcmd_enter(int cmd, const char *dcmd) "scmd %d: DCMD %s"
+disable megasas_dcmd_dummy(int cmd, unsigned long size) "scmd %d: DCMD dummy xfer len %ld"
+disable megasas_dcmd_set_fw_time(int cmd, unsigned long time) "scmd %d: Set FW time %lx"
+disable megasas_dcmd_pd_get_list(int cmd, int num, int max, int offset) "scmd %d: DCMD PD get list: %d / %d PDs, size %d"
+disable megasas_dcmd_ld_get_list(int cmd, int num, int max) "scmd %d: DCMD LD get list: found %d / %d LDs"
+disable megasas_dcmd_get_info(int cmd, const char *desc, int pd_id) "scmd %d: DCMD %s get info for dev %d"
+disable megasas_dcmd_pd_get_info(int cmd, int lun, int state) "scmd %d: set state for dev %d to %x"
+disable megasas_abort_frame(int cmd, int abort_cmd) "scmd %d: aborting frame %x"
+megasas_abort_no_cmd(int cmd, uint64_t context) "scmd %d: no active command for frame context %" PRIx64 ""
+megasas_abort_invalid_context(int cmd, uint64_t context, int abort_cmd) "scmd %d: invalid frame context %" PRIx64 " for abort frame %x"
+disable megasas_reset(void) "Reset"
+megasas_init(int sges, int cmds, const char *intr, const char *mode) "Using %d sges, %d cmds, %s, %s mode"

trace-events lm32_uart_irq_state(int level) "irq state %d" · line 452

Quoted 10 lines
trace-events +10 -0
+disable megasas_map_region(int num, const char *name, unsigned long addr) "mapping %s region %d at %08lx"
+disable megasas_irq_lower(const char *desc) "%s"
+disable megasas_irq_raise(const char *desc) "%s"
+disable megasas_readl_reg(const char *region, const char *reg, uint32_t val) "%s %s: 0x%x"
+disable megasas_readl(const char *region, unsigned long addr, uint32_t val) "%s 0x%lx: 0x%x"
+megasas_invalid_read(const char *region, unsigned long addr) "%s 0x%lx"
+disable megasas_writel_reg(const char *region, const char *reg, uint32_t val) "%s %s: 0x%x"
+disable megasas_writel(const char *region, uint32_t addr, uint32_t val) "%s 0x%x: 0x%x"
+megasas_invalid_write(const char *region, uint32_t addr, uint32_t val) "%s 0x%x: 0x%x"
+

Not sure why some of these still have "disable". Also, not all backends support string arguments, but that's not a problem as long as you stick to those that do. :)

Otherwise looks good!

Paolo

#2 lore raw
Quoted 68 lines · Paolo Bonzini
Quoted 67 lines · Hannes Reinecke
trace-events +67 -0
+# hw/megasas.c
+disable megasas_init_firmware(int xfer_len, uint64_t pa) "xfer len %d pa %" PRIx64 " "
+disable megasas_init_queue(uint64_t queue_pa, int queue_len, uint64_t head, uint64_t tail, uint32_t flags) "queue at %" PRIx64 " len %d head %" PRIx64 " tail %" PRIx64 " flags %x"
+megasas_initq_map_failed(int frame) "scmd %d: failed to map queue"
+megasas_initq_mismatch(int queue_len, int fw_cmds) "queue size %d max fw cmds %d"
+disable megasas_qf_found(unsigned int index, uint64_t pa) "found mapped frame %x pa %" PRIx64 ""
+disable megasas_qf_new(unsigned int index, void *cmd) "return new frame %x cmd %p"
+megasas_qf_failed(unsigned long pa) "all frames busy for frame %lx"
+disable megasas_qf_enqueue(unsigned int index, unsigned int count, uint64_t context, unsigned int tail, int busy) "enqueue frame %x count %d countext %" PRIx64 " tail %x busy %d"
+disable megasas_qf_update(unsigned int head, unsigned int busy) "update reply queue head %x busy %d"
+disable megasas_qf_dequeue(unsigned int index) "dequeue frame %x"
+disable megasas_qf_map_failed(int cmd, unsigned long frame) "scmd %d: frame %lu"
+disable megasas_qf_complete_noirq(uint64_t context) "context %" PRIx64 " "
+disable megasas_qf_complete(uint64_t context, unsigned int tail, unsigned int offset, int busy, unsigned int doorbell) "context %" PRIx64 " tail %x offset %d busy %d doorbell %x"
+disable megasas_handle_frame(const char *cmd, uint64_t addr, uint64_t context, uint32_t count) "MFI cmd %s addr %" PRIx64 " context %" PRIx64 " count %d"
+megasas_frame_busy(uint64_t addr) "frame %" PRIx64 " busy"
+megasas_unhandled_frame_cmd(int cmd, uint8_t frame_cmd) "scmd %d: Unhandled MFI cmd %x"
+disable megasas_handle_scsi(const char *frame, const char *desc, int dev, int lun, void *sdev, unsigned long size) "%s %s dev %x/%x sdev %p xfer %lu"
+disable megasas_scsi_target_not_present(const char *frame, const char *desc, int dev, int lun) "%s %s dev %x/%x target not present"
+megasas_scsi_invalid_cdb_len(const char *frame, const char *desc, int dev, int lun, int len) "%s %s dev %x/%x invalid cdb len %d"
+megasas_scsi_overflow(int cmd, const char *dir, int bytes, int len) "scmd %d: %s %d of %d bytes"
+disable megasas_scsi_underflow(int cmd, const char *dir, int bytes, int len) "scmd %d: %s %d of %d bytes"
+megasas_scsi_req_alloc_failed(const char *frame, int dev, int lun) "%s dev %x/%x req allocation failed"
+disable megasas_scsi_start(int cmd, const char *desc, int len) "scmd %d: %s %d bytes of data"
+disable megasas_scsi_nodata(int cmd) "scmd %d: no data to be transferred"
+disable megasas_scsi_complete(int cmd, uint32_t status, int len, int xfer) "scmd %d: finished with status %x, len %u/%u"
+disable megasas_command_complete(int cmd, uint32_t status) "scmd %d: command completed, status %x"
+disable megasas_handle_io(int cmd, const char *frame, int dev, int lun, unsigned long lba, unsigned long count) "scmd %d: %s dev %x/%x lba %lx count %lu"
+disable megasas_io_target_not_present(int cmd, const char *frame, int dev, int lun) "scmd %d: %s dev %x/%x LUN not present"
+disable megasas_io_start(int cmd, const char *dir, unsigned long lba, unsigned long count, unsigned long len) "scmd %d: %s start LBA %lx %lu blocks (%lu bytes)"
+disable megasas_io_complete(int cmd, uint32_t len) "scmd %d: %d bytes completed"
+disable megasas_io_copy(int cmd, const char *dir, int bytes, int len, unsigned long offset) "scmd %d: %s %d of %d bytes, iov offset %lu"
+disable megasas_io_continue(int cmd, int bytes) "scmd %d: %d bytes left"
+megasas_iovec_map_failed(int cmd, int index, unsigned long iov_size) "scmd %d: iovec %d size %lu"
+megasas_iovec_sgl_overflow(int cmd, int index, int limit) "scmd %d: iovec count %d limit %d"
+megasas_iovec_sgl_underflow(int cmd, int index) "scmd %d: iovec count %d"
+megasas_iovec_sgl_invalid(int cmd, int index, uint64_t pa, uint32_t len) "scmd %d: invalid sgl element %d pa %" PRIx64 " len %u"
+megasas_iovec_len(int cmd, const char *desc, int len, int limit) "scmd %d: iovec %s len %d limit %d"
+disable megasas_handle_dcmd(int cmd, int opcode) "scmd %d: MFI DCMD opcode %x"
+disable megasas_finish_dcmd(int cmd, int size) "scmd %d: MFI DCMD wrote %d bytes"
+megasas_dcmd_req_alloc_failed(int cmd, const char *desc) "scmd %d: %s alloc failed"
+disable megasas_dcmd_internal_submit(int cmd, const char *desc, int dev) "scmd %d: %s to dev %d"
+disable megasas_dcmd_internal_finish(int cmd, int opcode, int lun) "scmd %d: DCMD finish internal cmd %x lun %d"
+megasas_dcmd_internal_invalid(int cmd, int opcode) "scmd %d: Invalid internal DCMD %x"
+megasas_dcmd_unhandled(int cmd, int opcode, int len) "scmd %d: opcode %x, len %d"
+disable megasas_dcmd_zero_sge(int cmd) "scmd %d: zero DCMD sge count"
+megasas_dcmd_invalid_sge(int cmd, int count) "scmd %d: invalid DCMD sge count %d"
+megasas_dcmd_map_failed(int cmd) "scmd %d: Failed to map DCMD buffer"
+megasas_dcmd_invalid_xfer_len(int cmd, const char *dcmd, unsigned long size) "scmd %d: %s invalid xfer len %ld"
+disable megasas_dcmd_enter(int cmd, const char *dcmd) "scmd %d: DCMD %s"
+disable megasas_dcmd_dummy(int cmd, unsigned long size) "scmd %d: DCMD dummy xfer len %ld"
+disable megasas_dcmd_set_fw_time(int cmd, unsigned long time) "scmd %d: Set FW time %lx"
+disable megasas_dcmd_pd_get_list(int cmd, int num, int max, int offset) "scmd %d: DCMD PD get list: %d / %d PDs, size %d"
+disable megasas_dcmd_ld_get_list(int cmd, int num, int max) "scmd %d: DCMD LD get list: found %d / %d LDs"
+disable megasas_dcmd_get_info(int cmd, const char *desc, int pd_id) "scmd %d: DCMD %s get info for dev %d"
+disable megasas_dcmd_pd_get_info(int cmd, int lun, int state) "scmd %d: set state for dev %d to %x"
+disable megasas_abort_frame(int cmd, int abort_cmd) "scmd %d: aborting frame %x"
+megasas_abort_no_cmd(int cmd, uint64_t context) "scmd %d: no active command for frame context %" PRIx64 ""
+megasas_abort_invalid_context(int cmd, uint64_t context, int abort_cmd) "scmd %d: invalid frame context %" PRIx64 " for abort frame %x"
+disable megasas_reset(void) "Reset"
+megasas_init(int sges, int cmds, const char *intr, const char *mode) "Using %d sges, %d cmds, %s, %s mode"
+disable megasas_map_region(int num, const char *name, unsigned long addr) "mapping %s region %d at %08lx"
+disable megasas_irq_lower(const char *desc) "%s"
+disable megasas_irq_raise(const char *desc) "%s"
+disable megasas_readl_reg(const char *region, const char *reg, uint32_t val) "%s %s: 0x%x"
+disable megasas_readl(const char *region, unsigned long addr, uint32_t val) "%s 0x%lx: 0x%x"
+megasas_invalid_read(const char *region, unsigned long addr) "%s 0x%lx"
Quoted 8 lines

trace-events lm32_uart_irq_state(int level) "irq state %d" · line 452

Quoted 4 lines
trace-events +4 -0
+disable megasas_writel_reg(const char *region, const char *reg, uint32_t val) "%s %s: 0x%x"
+disable megasas_writel(const char *region, uint32_t addr, uint32_t val) "%s 0x%x: 0x%x"
+megasas_invalid_write(const char *region, uint32_t addr, uint32_t val) "%s 0x%x: 0x%x"
+

Not sure why some of these still have "disable". Also, not all backends support string arguments, but that's not a problem as long as you stick to those that do. :)

The disable is not needed anymore. The semantics in qemu.git/master are that trace events are disabled on startup by default. You can also provide a file containing the events you want to enable using qemu -trace events=./my-events.

The simple backend will support %s formats soon. If possible, I still prefer non-string arguments, but don't worry about using them if it improves the trace output quality.

Stefan

#3 lore raw
Quoted 78 lines · Stefan Hajnoczi
Quoted 68 lines · Paolo Bonzini
Quoted 67 lines · Hannes Reinecke
trace-events +67 -0
+# hw/megasas.c
+disable megasas_init_firmware(int xfer_len, uint64_t pa) "xfer len %d pa %" PRIx64 " "
+disable megasas_init_queue(uint64_t queue_pa, int queue_len, uint64_t head, uint64_t tail, uint32_t flags) "queue at %" PRIx64 " len %d head %" PRIx64 " tail %" PRIx64 " flags %x"
+megasas_initq_map_failed(int frame) "scmd %d: failed to map queue"
+megasas_initq_mismatch(int queue_len, int fw_cmds) "queue size %d max fw cmds %d"
+disable megasas_qf_found(unsigned int index, uint64_t pa) "found mapped frame %x pa %" PRIx64 ""
+disable megasas_qf_new(unsigned int index, void *cmd) "return new frame %x cmd %p"
+megasas_qf_failed(unsigned long pa) "all frames busy for frame %lx"
+disable megasas_qf_enqueue(unsigned int index, unsigned int count, uint64_t context, unsigned int tail, int busy) "enqueue frame %x count %d countext %" PRIx64 " tail %x busy %d"
+disable megasas_qf_update(unsigned int head, unsigned int busy) "update reply queue head %x busy %d"
+disable megasas_qf_dequeue(unsigned int index) "dequeue frame %x"
+disable megasas_qf_map_failed(int cmd, unsigned long frame) "scmd %d: frame %lu"
+disable megasas_qf_complete_noirq(uint64_t context) "context %" PRIx64 " "
+disable megasas_qf_complete(uint64_t context, unsigned int tail, unsigned int offset, int busy, unsigned int doorbell) "context %" PRIx64 " tail %x offset %d busy %d doorbell %x"
+disable megasas_handle_frame(const char *cmd, uint64_t addr, uint64_t context, uint32_t count) "MFI cmd %s addr %" PRIx64 " context %" PRIx64 " count %d"
+megasas_frame_busy(uint64_t addr) "frame %" PRIx64 " busy"
+megasas_unhandled_frame_cmd(int cmd, uint8_t frame_cmd) "scmd %d: Unhandled MFI cmd %x"
+disable megasas_handle_scsi(const char *frame, const char *desc, int dev, int lun, void *sdev, unsigned long size) "%s %s dev %x/%x sdev %p xfer %lu"
+disable megasas_scsi_target_not_present(const char *frame, const char *desc, int dev, int lun) "%s %s dev %x/%x target not present"
+megasas_scsi_invalid_cdb_len(const char *frame, const char *desc, int dev, int lun, int len) "%s %s dev %x/%x invalid cdb len %d"
+megasas_scsi_overflow(int cmd, const char *dir, int bytes, int len) "scmd %d: %s %d of %d bytes"
+disable megasas_scsi_underflow(int cmd, const char *dir, int bytes, int len) "scmd %d: %s %d of %d bytes"
+megasas_scsi_req_alloc_failed(const char *frame, int dev, int lun) "%s dev %x/%x req allocation failed"
+disable megasas_scsi_start(int cmd, const char *desc, int len) "scmd %d: %s %d bytes of data"
+disable megasas_scsi_nodata(int cmd) "scmd %d: no data to be transferred"
+disable megasas_scsi_complete(int cmd, uint32_t status, int len, int xfer) "scmd %d: finished with status %x, len %u/%u"
+disable megasas_command_complete(int cmd, uint32_t status) "scmd %d: command completed, status %x"
+disable megasas_handle_io(int cmd, const char *frame, int dev, int lun, unsigned long lba, unsigned long count) "scmd %d: %s dev %x/%x lba %lx count %lu"
+disable megasas_io_target_not_present(int cmd, const char *frame, int dev, int lun) "scmd %d: %s dev %x/%x LUN not present"
+disable megasas_io_start(int cmd, const char *dir, unsigned long lba, unsigned long count, unsigned long len) "scmd %d: %s start LBA %lx %lu blocks (%lu bytes)"
+disable megasas_io_complete(int cmd, uint32_t len) "scmd %d: %d bytes completed"
+disable megasas_io_copy(int cmd, const char *dir, int bytes, int len, unsigned long offset) "scmd %d: %s %d of %d bytes, iov offset %lu"
+disable megasas_io_continue(int cmd, int bytes) "scmd %d: %d bytes left"
+megasas_iovec_map_failed(int cmd, int index, unsigned long iov_size) "scmd %d: iovec %d size %lu"
+megasas_iovec_sgl_overflow(int cmd, int index, int limit) "scmd %d: iovec count %d limit %d"
+megasas_iovec_sgl_underflow(int cmd, int index) "scmd %d: iovec count %d"
+megasas_iovec_sgl_invalid(int cmd, int index, uint64_t pa, uint32_t len) "scmd %d: invalid sgl element %d pa %" PRIx64 " len %u"
+megasas_iovec_len(int cmd, const char *desc, int len, int limit) "scmd %d: iovec %s len %d limit %d"
+disable megasas_handle_dcmd(int cmd, int opcode) "scmd %d: MFI DCMD opcode %x"
+disable megasas_finish_dcmd(int cmd, int size) "scmd %d: MFI DCMD wrote %d bytes"
+megasas_dcmd_req_alloc_failed(int cmd, const char *desc) "scmd %d: %s alloc failed"
+disable megasas_dcmd_internal_submit(int cmd, const char *desc, int dev) "scmd %d: %s to dev %d"
+disable megasas_dcmd_internal_finish(int cmd, int opcode, int lun) "scmd %d: DCMD finish internal cmd %x lun %d"
+megasas_dcmd_internal_invalid(int cmd, int opcode) "scmd %d: Invalid internal DCMD %x"
+megasas_dcmd_unhandled(int cmd, int opcode, int len) "scmd %d: opcode %x, len %d"
+disable megasas_dcmd_zero_sge(int cmd) "scmd %d: zero DCMD sge count"
+megasas_dcmd_invalid_sge(int cmd, int count) "scmd %d: invalid DCMD sge count %d"
+megasas_dcmd_map_failed(int cmd) "scmd %d: Failed to map DCMD buffer"
+megasas_dcmd_invalid_xfer_len(int cmd, const char *dcmd, unsigned long size) "scmd %d: %s invalid xfer len %ld"
+disable megasas_dcmd_enter(int cmd, const char *dcmd) "scmd %d: DCMD %s"
+disable megasas_dcmd_dummy(int cmd, unsigned long size) "scmd %d: DCMD dummy xfer len %ld"
+disable megasas_dcmd_set_fw_time(int cmd, unsigned long time) "scmd %d: Set FW time %lx"
+disable megasas_dcmd_pd_get_list(int cmd, int num, int max, int offset) "scmd %d: DCMD PD get list: %d / %d PDs, size %d"
+disable megasas_dcmd_ld_get_list(int cmd, int num, int max) "scmd %d: DCMD LD get list: found %d / %d LDs"
+disable megasas_dcmd_get_info(int cmd, const char *desc, int pd_id) "scmd %d: DCMD %s get info for dev %d"
+disable megasas_dcmd_pd_get_info(int cmd, int lun, int state) "scmd %d: set state for dev %d to %x"
+disable megasas_abort_frame(int cmd, int abort_cmd) "scmd %d: aborting frame %x"
+megasas_abort_no_cmd(int cmd, uint64_t context) "scmd %d: no active command for frame context %" PRIx64 ""
+megasas_abort_invalid_context(int cmd, uint64_t context, int abort_cmd) "scmd %d: invalid frame context %" PRIx64 " for abort frame %x"
+disable megasas_reset(void) "Reset"
+megasas_init(int sges, int cmds, const char *intr, const char *mode) "Using %d sges, %d cmds, %s, %s mode"
+disable megasas_map_region(int num, const char *name, unsigned long addr) "mapping %s region %d at %08lx"
+disable megasas_irq_lower(const char *desc) "%s"
+disable megasas_irq_raise(const char *desc) "%s"
+disable megasas_readl_reg(const char *region, const char *reg, uint32_t val) "%s %s: 0x%x"
+disable megasas_readl(const char *region, unsigned long addr, uint32_t val) "%s 0x%lx: 0x%x"
+megasas_invalid_read(const char *region, unsigned long addr) "%s 0x%lx"
Quoted 8 lines

trace-events lm32_uart_irq_state(int level) "irq state %d" · line 452

Quoted 4 lines
trace-events +4 -0
+disable megasas_writel_reg(const char *region, const char *reg, uint32_t val) "%s %s: 0x%x"
+disable megasas_writel(const char *region, uint32_t addr, uint32_t val) "%s 0x%x: 0x%x"
+megasas_invalid_write(const char *region, uint32_t addr, uint32_t val) "%s 0x%x: 0x%x"
+

Not sure why some of these still have "disable". Also, not all backends support string arguments, but that's not a problem as long as you stick to those that do. :)

Quoted 9 lines

The disable is not needed anymore. The semantics in qemu.git/master are that trace events are disabled on startup by default. You can also provide a file containing the events you want to enable using qemu -trace events=./my-events.

The simple backend will support %s formats soon. If possible, I still prefer non-string arguments, but don't worry about using them if it improves the trace output quality.

So, I should be removing the 'disable' keyword, then, correct?

The strings are just there to avoid trace statement duplication. But if that's not a problem then I can easily convert the strings to individual trace statements.

Cheers,

Hannes

Signature · 4 lines
Dr. Hannes Reinecke		      zSeries & Storage
[email protected]			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
#4 lore raw
Quoted 1 line · Hannes Reinecke

So, I should be removing the 'disable' keyword, then, correct?

Yes.

Quoted 3 lines

The strings are just there to avoid trace statement duplication. But if that's not a problem then I can easily convert the strings to individual trace statements.

No, don't bother.

Paolo