Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ata: libata: tracepoints for bus-master DMA

Add tracepoints for bus-master DMA and taskfile related functions.
That allows us to drop the relevant DPRINTK() calls.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>

authored by

Hannes Reinecke and committed by
Damien Le Moal
c206a389 fc914faa

+201 -97
+7 -1
drivers/ata/ata_piix.c
··· 77 77 #include <scsi/scsi_host.h> 78 78 #include <linux/libata.h> 79 79 #include <linux/dmi.h> 80 + #include <trace/events/libata.h> 80 81 81 82 #define DRV_NAME "ata_piix" 82 83 #define DRV_VERSION "2.13" ··· 817 816 818 817 static bool piix_irq_check(struct ata_port *ap) 819 818 { 819 + unsigned char host_stat; 820 + 820 821 if (unlikely(!ap->ioaddr.bmdma_addr)) 821 822 return false; 822 823 823 - return ap->ops->bmdma_status(ap) & ATA_DMA_INTR; 824 + host_stat = ap->ops->bmdma_status(ap); 825 + trace_ata_bmdma_status(ap, host_stat); 826 + 827 + return host_stat & ATA_DMA_INTR; 824 828 } 825 829 826 830 #ifdef CONFIG_PM_SLEEP
+6
drivers/ata/libata-core.c
··· 6576 6576 dev_printk(KERN_DEBUG, dev, "version %s\n", version); 6577 6577 } 6578 6578 EXPORT_SYMBOL(ata_print_version); 6579 + 6580 + EXPORT_TRACEPOINT_SYMBOL_GPL(ata_tf_load); 6581 + EXPORT_TRACEPOINT_SYMBOL_GPL(ata_exec_command); 6582 + EXPORT_TRACEPOINT_SYMBOL_GPL(ata_bmdma_setup); 6583 + EXPORT_TRACEPOINT_SYMBOL_GPL(ata_bmdma_start); 6584 + EXPORT_TRACEPOINT_SYMBOL_GPL(ata_bmdma_status);
+21 -23
drivers/ata/libata-sff.c
··· 18 18 #include <linux/module.h> 19 19 #include <linux/libata.h> 20 20 #include <linux/highmem.h> 21 - 21 + #include <trace/events/libata.h> 22 22 #include "libata.h" 23 23 24 24 static struct workqueue_struct *ata_sff_wq; ··· 409 409 iowrite8(tf->hob_lbal, ioaddr->lbal_addr); 410 410 iowrite8(tf->hob_lbam, ioaddr->lbam_addr); 411 411 iowrite8(tf->hob_lbah, ioaddr->lbah_addr); 412 - VPRINTK("hob: feat 0x%X nsect 0x%X, lba 0x%X 0x%X 0x%X\n", 413 - tf->hob_feature, 414 - tf->hob_nsect, 415 - tf->hob_lbal, 416 - tf->hob_lbam, 417 - tf->hob_lbah); 418 412 } 419 413 420 414 if (is_addr) { ··· 417 423 iowrite8(tf->lbal, ioaddr->lbal_addr); 418 424 iowrite8(tf->lbam, ioaddr->lbam_addr); 419 425 iowrite8(tf->lbah, ioaddr->lbah_addr); 420 - VPRINTK("feat 0x%X nsect 0x%X lba 0x%X 0x%X 0x%X\n", 421 - tf->feature, 422 - tf->nsect, 423 - tf->lbal, 424 - tf->lbam, 425 - tf->lbah); 426 426 } 427 427 428 - if (tf->flags & ATA_TFLAG_DEVICE) { 428 + if (tf->flags & ATA_TFLAG_DEVICE) 429 429 iowrite8(tf->device, ioaddr->device_addr); 430 - VPRINTK("device 0x%X\n", tf->device); 431 - } 432 430 433 431 ata_wait_idle(ap); 434 432 } ··· 480 494 */ 481 495 void ata_sff_exec_command(struct ata_port *ap, const struct ata_taskfile *tf) 482 496 { 483 - DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); 484 - 485 497 iowrite8(tf->command, ap->ioaddr.command_addr); 486 498 ata_sff_pause(ap); 487 499 } ··· 489 505 * ata_tf_to_host - issue ATA taskfile to host controller 490 506 * @ap: port to which command is being issued 491 507 * @tf: ATA taskfile register set 508 + * @tag: tag of the associated command 492 509 * 493 510 * Issues ATA taskfile register set to ATA host controller, 494 511 * with proper synchronization with interrupt handler and ··· 499 514 * spin_lock_irqsave(host lock) 500 515 */ 501 516 static inline void ata_tf_to_host(struct ata_port *ap, 502 - const struct ata_taskfile *tf) 517 + const struct ata_taskfile *tf, 518 + unsigned int tag) 503 519 { 520 + trace_ata_tf_load(ap, tf); 504 521 ap->ops->sff_tf_load(ap, tf); 522 + trace_ata_exec_command(ap, tf, tag); 505 523 ap->ops->sff_exec_command(ap, tf); 506 524 } 507 525 ··· 756 768 case ATAPI_PROT_DMA: 757 769 ap->hsm_task_state = HSM_ST_LAST; 758 770 /* initiate bmdma */ 771 + trace_ata_bmdma_start(ap, &qc->tf, qc->tag); 759 772 ap->ops->bmdma_start(qc); 760 773 break; 761 774 #endif /* CONFIG_ATA_BMDMA */ ··· 1365 1376 if (qc->tf.flags & ATA_TFLAG_POLLING) 1366 1377 ata_qc_set_polling(qc); 1367 1378 1368 - ata_tf_to_host(ap, &qc->tf); 1379 + ata_tf_to_host(ap, &qc->tf, qc->tag); 1369 1380 ap->hsm_task_state = HSM_ST_LAST; 1370 1381 1371 1382 if (qc->tf.flags & ATA_TFLAG_POLLING) ··· 1377 1388 if (qc->tf.flags & ATA_TFLAG_POLLING) 1378 1389 ata_qc_set_polling(qc); 1379 1390 1380 - ata_tf_to_host(ap, &qc->tf); 1391 + ata_tf_to_host(ap, &qc->tf, qc->tag); 1381 1392 1382 1393 if (qc->tf.flags & ATA_TFLAG_WRITE) { 1383 1394 /* PIO data out protocol */ ··· 1407 1418 if (qc->tf.flags & ATA_TFLAG_POLLING) 1408 1419 ata_qc_set_polling(qc); 1409 1420 1410 - ata_tf_to_host(ap, &qc->tf); 1421 + ata_tf_to_host(ap, &qc->tf, qc->tag); 1411 1422 1412 1423 ap->hsm_task_state = HSM_ST_FIRST; 1413 1424 ··· 2734 2745 case ATA_PROT_DMA: 2735 2746 WARN_ON_ONCE(qc->tf.flags & ATA_TFLAG_POLLING); 2736 2747 2748 + trace_ata_tf_load(ap, &qc->tf); 2737 2749 ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */ 2750 + trace_ata_bmdma_setup(ap, &qc->tf, qc->tag); 2738 2751 ap->ops->bmdma_setup(qc); /* set up bmdma */ 2752 + trace_ata_bmdma_start(ap, &qc->tf, qc->tag); 2739 2753 ap->ops->bmdma_start(qc); /* initiate bmdma */ 2740 2754 ap->hsm_task_state = HSM_ST_LAST; 2741 2755 break; ··· 2746 2754 case ATAPI_PROT_DMA: 2747 2755 WARN_ON_ONCE(qc->tf.flags & ATA_TFLAG_POLLING); 2748 2756 2757 + trace_ata_tf_load(ap, &qc->tf); 2749 2758 ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */ 2759 + trace_ata_bmdma_setup(ap, &qc->tf, qc->tag); 2750 2760 ap->ops->bmdma_setup(qc); /* set up bmdma */ 2751 2761 ap->hsm_task_state = HSM_ST_FIRST; 2752 2762 ··· 2789 2795 if (ap->hsm_task_state == HSM_ST_LAST && ata_is_dma(qc->tf.protocol)) { 2790 2796 /* check status of DMA engine */ 2791 2797 host_stat = ap->ops->bmdma_status(ap); 2792 - VPRINTK("ata%u: host_stat 0x%X\n", ap->print_id, host_stat); 2798 + trace_ata_bmdma_status(ap, host_stat); 2793 2799 2794 2800 /* if it's not our irq... */ 2795 2801 if (!(host_stat & ATA_DMA_INTR)) 2796 2802 return ata_sff_idle_irq(ap); 2797 2803 2798 2804 /* before we do anything else, clear DMA-Start bit */ 2805 + trace_ata_bmdma_stop(ap, &qc->tf, qc->tag); 2799 2806 ap->ops->bmdma_stop(qc); 2800 2807 bmdma_stopped = true; 2801 2808 ··· 2865 2870 u8 host_stat; 2866 2871 2867 2872 host_stat = ap->ops->bmdma_status(ap); 2873 + trace_ata_bmdma_status(ap, host_stat); 2868 2874 2869 2875 /* BMDMA controllers indicate host bus error by 2870 2876 * setting DMA_ERR bit and timing out. As it wasn't ··· 2877 2881 thaw = true; 2878 2882 } 2879 2883 2884 + trace_ata_bmdma_stop(ap, &qc->tf, qc->tag); 2880 2885 ap->ops->bmdma_stop(qc); 2881 2886 2882 2887 /* if we're gonna thaw, make sure IRQ is clear */ ··· 2911 2914 2912 2915 if (ata_is_dma(qc->tf.protocol)) { 2913 2916 spin_lock_irqsave(ap->lock, flags); 2917 + trace_ata_bmdma_stop(ap, &qc->tf, qc->tag); 2914 2918 ap->ops->bmdma_stop(qc); 2915 2919 spin_unlock_irqrestore(ap->lock, flags); 2916 2920 }
+18
drivers/ata/libata-trace.c
··· 39 39 } 40 40 41 41 const char * 42 + libata_trace_parse_host_stat(struct trace_seq *p, unsigned char host_stat) 43 + { 44 + const char *ret = trace_seq_buffer_ptr(p); 45 + 46 + trace_seq_printf(p, "{ "); 47 + if (host_stat & ATA_DMA_INTR) 48 + trace_seq_printf(p, "INTR "); 49 + if (host_stat & ATA_DMA_ERR) 50 + trace_seq_printf(p, "ERR "); 51 + if (host_stat & ATA_DMA_ACTIVE) 52 + trace_seq_printf(p, "ACTIVE "); 53 + trace_seq_putc(p, '}'); 54 + trace_seq_putc(p, 0); 55 + 56 + return ret; 57 + } 58 + 59 + const char * 42 60 libata_trace_parse_eh_action(struct trace_seq *p, unsigned int eh_action) 43 61 { 44 62 const char *ret = trace_seq_buffer_ptr(p);
+3
drivers/ata/pata_arasan_cf.c
··· 39 39 #include <linux/spinlock.h> 40 40 #include <linux/types.h> 41 41 #include <linux/workqueue.h> 42 + #include <trace/events/libata.h> 42 43 43 44 #define DRIVER_NAME "arasan_cf" 44 45 #define TIMEOUT msecs_to_jiffies(3000) ··· 704 703 case ATA_PROT_DMA: 705 704 WARN_ON_ONCE(qc->tf.flags & ATA_TFLAG_POLLING); 706 705 706 + trace_ata_tf_load(ap, &qc->tf); 707 707 ap->ops->sff_tf_load(ap, &qc->tf); 708 708 acdev->dma_status = 0; 709 709 acdev->qc = qc; 710 + trace_ata_bmdma_start(ap, &qc->tf, qc->tag); 710 711 arasan_cf_dma_start(acdev); 711 712 ap->hsm_task_state = HSM_ST_LAST; 712 713 break;
+7 -11
drivers/ata/pata_octeon_cf.c
··· 19 19 #include <linux/of_platform.h> 20 20 #include <linux/platform_device.h> 21 21 #include <scsi/scsi_host.h> 22 - 22 + #include <trace/events/libata.h> 23 23 #include <asm/byteorder.h> 24 24 #include <asm/octeon/octeon.h> 25 25 ··· 514 514 { 515 515 /* The base of the registers is at ioaddr.data_addr. */ 516 516 void __iomem *base = ap->ioaddr.data_addr; 517 - u16 blob; 517 + u16 blob = 0; 518 518 519 - if (tf->flags & ATA_TFLAG_DEVICE) { 520 - VPRINTK("device 0x%X\n", tf->device); 519 + if (tf->flags & ATA_TFLAG_DEVICE) 521 520 blob = tf->device; 522 - } else { 523 - blob = 0; 524 - } 525 521 526 - DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); 527 522 blob |= (tf->command << 8); 528 523 __raw_writew(blob, base + 6); 529 - 530 524 531 525 ata_wait_idle(ap); 532 526 } ··· 535 541 struct octeon_cf_port *cf_port; 536 542 537 543 cf_port = ap->private_data; 538 - DPRINTK("ENTER\n"); 539 544 /* issue r/w command */ 540 545 qc->cursg = qc->sg; 541 546 cf_port->dma_finished = 0; 542 547 ap->ops->sff_exec_command(ap, &qc->tf); 543 - DPRINTK("EXIT\n"); 544 548 } 545 549 546 550 /** ··· 691 699 if (!sg_is_last(qc->cursg)) { 692 700 qc->cursg = sg_next(qc->cursg); 693 701 handled = 1; 702 + trace_ata_bmdma_start(ap, &qc->tf, qc->tag); 694 703 octeon_cf_dma_start(qc); 695 704 continue; 696 705 } else { ··· 791 798 case ATA_PROT_DMA: 792 799 WARN_ON(qc->tf.flags & ATA_TFLAG_POLLING); 793 800 801 + trace_ata_tf_load(ap, &qc->tf); 794 802 ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */ 803 + trace_ata_bmdma_setup(ap, &qc->tf, qc->tag); 795 804 octeon_cf_dma_setup(qc); /* set up dma */ 805 + trace_ata_bmdma_start(ap, &qc->tf, qc->tag); 796 806 octeon_cf_dma_start(qc); /* initiate dma */ 797 807 ap->hsm_task_state = HSM_ST_LAST; 798 808 break;
-2
drivers/ata/pata_pdc202xx_old.c
··· 38 38 static void pdc202xx_exec_command(struct ata_port *ap, 39 39 const struct ata_taskfile *tf) 40 40 { 41 - DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); 42 - 43 41 iowrite8(tf->command, ap->ioaddr.command_addr); 44 42 ndelay(400); 45 43 }
-1
drivers/ata/pata_sil680.c
··· 212 212 static void sil680_sff_exec_command(struct ata_port *ap, 213 213 const struct ata_taskfile *tf) 214 214 { 215 - DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); 216 215 iowrite8(tf->command, ap->ioaddr.command_addr); 217 216 ioread8(ap->ioaddr.bmdma_addr + ATA_DMA_CMD); 218 217 }
+10 -49
drivers/ata/sata_dwc_460ex.c
··· 34 34 #include <linux/phy/phy.h> 35 35 #include <linux/libata.h> 36 36 #include <linux/slab.h> 37 + #include <trace/events/libata.h> 37 38 38 39 #include "libata.h" 39 40 ··· 296 295 } 297 296 } 298 297 298 + #ifdef DEBUG_NCQ 299 299 static const char *get_dma_dir_descript(int dma_dir) 300 300 { 301 301 switch ((enum dma_data_direction)dma_dir) { ··· 310 308 return "none"; 311 309 } 312 310 } 313 - 314 - static void sata_dwc_tf_dump(struct ata_port *ap, struct ata_taskfile *tf) 315 - { 316 - dev_vdbg(ap->dev, 317 - "taskfile cmd: 0x%02x protocol: %s flags: 0x%lx device: %x\n", 318 - tf->command, get_prot_descript(tf->protocol), tf->flags, 319 - tf->device); 320 - dev_vdbg(ap->dev, 321 - "feature: 0x%02x nsect: 0x%x lbal: 0x%x lbam: 0x%x lbah: 0x%x\n", 322 - tf->feature, tf->nsect, tf->lbal, tf->lbam, tf->lbah); 323 - dev_vdbg(ap->dev, 324 - "hob_feature: 0x%02x hob_nsect: 0x%x hob_lbal: 0x%x hob_lbam: 0x%x hob_lbah: 0x%x\n", 325 - tf->hob_feature, tf->hob_nsect, tf->hob_lbal, tf->hob_lbam, 326 - tf->hob_lbah); 327 - } 311 + #endif 328 312 329 313 static void dma_dwc_xfer_done(void *hsdev_instance) 330 314 { ··· 539 551 * active tag. It is the tag that matches the command about to 540 552 * be completed. 541 553 */ 554 + trace_ata_bmdma_start(ap, &qc->tf, tag); 542 555 qc->ap->link.active_tag = tag; 543 556 sata_dwc_bmdma_start_by_tag(qc, tag); 544 557 ··· 967 978 { 968 979 struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap); 969 980 970 - dev_dbg(ap->dev, "%s cmd(0x%02x): %s tag=%d\n", __func__, tf->command, 971 - ata_get_cmd_descript(tf->command), tag); 972 - 973 981 hsdevp->cmd_issued[tag] = cmd_issued; 974 982 975 983 /* ··· 989 1003 { 990 1004 u8 tag = qc->hw_tag; 991 1005 992 - if (ata_is_ncq(qc->tf.protocol)) { 993 - dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n", 994 - __func__, qc->ap->link.sactive, tag); 995 - } else { 1006 + if (!ata_is_ncq(qc->tf.protocol)) 996 1007 tag = 0; 997 - } 1008 + 998 1009 sata_dwc_bmdma_setup_by_tag(qc, tag); 999 1010 } 1000 1011 ··· 1018 1035 start_dma = 0; 1019 1036 } 1020 1037 1021 - dev_dbg(ap->dev, 1022 - "%s qc=%p tag: %x cmd: 0x%02x dma_dir: %s start_dma? %x\n", 1023 - __func__, qc, tag, qc->tf.command, 1024 - get_dma_dir_descript(qc->dma_dir), start_dma); 1025 - sata_dwc_tf_dump(ap, &qc->tf); 1026 - 1027 1038 if (start_dma) { 1028 1039 sata_dwc_scr_read(&ap->link, SCR_ERROR, &reg); 1029 1040 if (reg & SATA_DWC_SERROR_ERR_BITS) { ··· 1042 1065 { 1043 1066 u8 tag = qc->hw_tag; 1044 1067 1045 - if (ata_is_ncq(qc->tf.protocol)) { 1046 - dev_dbg(qc->ap->dev, "%s: ap->link.sactive=0x%08x tag=%d\n", 1047 - __func__, qc->ap->link.sactive, tag); 1048 - } else { 1068 + if (!ata_is_ncq(qc->tf.protocol)) 1049 1069 tag = 0; 1050 - } 1051 - dev_dbg(qc->ap->dev, "%s\n", __func__); 1070 + 1052 1071 sata_dwc_bmdma_start_by_tag(qc, tag); 1053 1072 } 1054 1073 ··· 1054 1081 u8 tag = qc->hw_tag; 1055 1082 struct ata_port *ap = qc->ap; 1056 1083 struct sata_dwc_device_port *hsdevp = HSDEVP_FROM_AP(ap); 1057 - 1058 - #ifdef DEBUG_NCQ 1059 - if (qc->hw_tag > 0 || ap->link.sactive > 1) 1060 - dev_info(ap->dev, 1061 - "%s ap id=%d cmd(0x%02x)=%s qc tag=%d prot=%s ap active_tag=0x%08x ap sactive=0x%08x\n", 1062 - __func__, ap->print_id, qc->tf.command, 1063 - ata_get_cmd_descript(qc->tf.command), 1064 - qc->hw_tag, get_prot_descript(qc->tf.protocol), 1065 - ap->link.active_tag, ap->link.sactive); 1066 - #endif 1067 1084 1068 1085 if (!ata_is_ncq(qc->tf.protocol)) 1069 1086 tag = 0; ··· 1071 1108 sactive |= (0x00000001 << tag); 1072 1109 sata_dwc_scr_write(&ap->link, SCR_ACTIVE, sactive); 1073 1110 1074 - dev_dbg(qc->ap->dev, 1075 - "%s: tag=%d ap->link.sactive = 0x%08x sactive=0x%08x\n", 1076 - __func__, tag, qc->ap->link.sactive, sactive); 1077 - 1111 + trace_ata_tf_load(ap, &qc->tf); 1078 1112 ap->ops->sff_tf_load(ap, &qc->tf); 1113 + trace_ata_exec_command(ap, &qc->tf, tag); 1079 1114 sata_dwc_exec_command_by_tag(ap, &qc->tf, tag, 1080 1115 SATA_DWC_CMD_ISSUED_PEND); 1081 1116 } else {
+4 -8
drivers/ata/sata_nv.c
··· 31 31 #include <scsi/scsi_host.h> 32 32 #include <scsi/scsi_device.h> 33 33 #include <linux/libata.h> 34 + #include <trace/events/libata.h> 34 35 35 36 #define DRV_NAME "sata_nv" 36 37 #define DRV_VERSION "3.5" ··· 1435 1434 1436 1435 writew(qc->hw_tag, mmio + NV_ADMA_APPEND); 1437 1436 1438 - DPRINTK("Issued tag %u\n", qc->hw_tag); 1439 - 1440 1437 return 0; 1441 1438 } 1442 1439 ··· 2012 2013 if (qc == NULL) 2013 2014 return 0; 2014 2015 2015 - DPRINTK("Enter\n"); 2016 - 2017 2016 writel((1 << qc->hw_tag), pp->sactive_block); 2018 2017 pp->last_issue_tag = qc->hw_tag; 2019 2018 pp->dhfis_bits &= ~(1 << qc->hw_tag); 2020 2019 pp->dmafis_bits &= ~(1 << qc->hw_tag); 2021 2020 pp->qc_active |= (0x1 << qc->hw_tag); 2022 2021 2022 + trace_ata_tf_load(ap, &qc->tf); 2023 2023 ap->ops->sff_tf_load(ap, &qc->tf); /* load tf registers */ 2024 + trace_ata_exec_command(ap, &qc->tf, qc->hw_tag); 2024 2025 ap->ops->sff_exec_command(ap, &qc->tf); 2025 - 2026 - DPRINTK("Issued tag %u\n", qc->hw_tag); 2027 2026 2028 2027 return 0; 2029 2028 } ··· 2033 2036 2034 2037 if (qc->tf.protocol != ATA_PROT_NCQ) 2035 2038 return ata_bmdma_qc_issue(qc); 2036 - 2037 - DPRINTK("Enter\n"); 2038 2039 2039 2040 if (!pp->qc_active) 2040 2041 nv_swncq_issue_atacmd(ap, qc); ··· 2078 2083 u8 lack_dhfis = 0; 2079 2084 2080 2085 host_stat = ap->ops->bmdma_status(ap); 2086 + trace_ata_bmdma_status(ap, host_stat); 2081 2087 if (unlikely(host_stat & ATA_DMA_ERR)) { 2082 2088 /* error when transferring data to/from memory */ 2083 2089 ata_ehi_clear_desc(ehi);
-2
drivers/ata/sata_rcar.c
··· 436 436 static void sata_rcar_exec_command(struct ata_port *ap, 437 437 const struct ata_taskfile *tf) 438 438 { 439 - DPRINTK("ata%u: cmd 0x%X\n", ap->print_id, tf->command); 440 - 441 439 iowrite32(tf->command, ap->ioaddr.command_addr); 442 440 ata_sff_pause(ap); 443 441 }
+125
include/trace/events/libata.h
··· 151 151 const char *libata_trace_parse_status(struct trace_seq*, unsigned char); 152 152 #define __parse_status(s) libata_trace_parse_status(p, s) 153 153 154 + const char *libata_trace_parse_host_stat(struct trace_seq *, unsigned char); 155 + #define __parse_host_stat(s) libata_trace_parse_host_stat(p, s) 156 + 154 157 const char *libata_trace_parse_eh_action(struct trace_seq *, unsigned int); 155 158 #define __parse_eh_action(a) libata_trace_parse_eh_action(p, a) 156 159 ··· 301 298 DEFINE_EVENT(ata_qc_complete_template, ata_qc_complete_done, 302 299 TP_PROTO(struct ata_queued_cmd *qc), 303 300 TP_ARGS(qc)); 301 + 302 + TRACE_EVENT(ata_tf_load, 303 + 304 + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf), 305 + 306 + TP_ARGS(ap, tf), 307 + 308 + TP_STRUCT__entry( 309 + __field( unsigned int, ata_port ) 310 + __field( unsigned char, cmd ) 311 + __field( unsigned char, dev ) 312 + __field( unsigned char, lbal ) 313 + __field( unsigned char, lbam ) 314 + __field( unsigned char, lbah ) 315 + __field( unsigned char, nsect ) 316 + __field( unsigned char, feature ) 317 + __field( unsigned char, hob_lbal ) 318 + __field( unsigned char, hob_lbam ) 319 + __field( unsigned char, hob_lbah ) 320 + __field( unsigned char, hob_nsect ) 321 + __field( unsigned char, hob_feature ) 322 + __field( unsigned char, proto ) 323 + ), 324 + 325 + TP_fast_assign( 326 + __entry->ata_port = ap->print_id; 327 + __entry->proto = tf->protocol; 328 + __entry->cmd = tf->command; 329 + __entry->dev = tf->device; 330 + __entry->lbal = tf->lbal; 331 + __entry->lbam = tf->lbam; 332 + __entry->lbah = tf->lbah; 333 + __entry->hob_lbal = tf->hob_lbal; 334 + __entry->hob_lbam = tf->hob_lbam; 335 + __entry->hob_lbah = tf->hob_lbah; 336 + __entry->feature = tf->feature; 337 + __entry->hob_feature = tf->hob_feature; 338 + __entry->nsect = tf->nsect; 339 + __entry->hob_nsect = tf->hob_nsect; 340 + ), 341 + 342 + TP_printk("ata_port=%u proto=%s cmd=%s%s " \ 343 + " tf=(%02x/%02x:%02x:%02x:%02x:%02x/%02x:%02x:%02x:%02x:%02x/%02x)", 344 + __entry->ata_port, 345 + show_protocol_name(__entry->proto), 346 + show_opcode_name(__entry->cmd), 347 + __parse_subcmd(__entry->cmd, __entry->feature, __entry->hob_nsect), 348 + __entry->cmd, __entry->feature, __entry->nsect, 349 + __entry->lbal, __entry->lbam, __entry->lbah, 350 + __entry->hob_feature, __entry->hob_nsect, 351 + __entry->hob_lbal, __entry->hob_lbam, __entry->hob_lbah, 352 + __entry->dev) 353 + ); 354 + 355 + DECLARE_EVENT_CLASS(ata_exec_command_template, 356 + 357 + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag), 358 + 359 + TP_ARGS(ap, tf, tag), 360 + 361 + TP_STRUCT__entry( 362 + __field( unsigned int, ata_port ) 363 + __field( unsigned int, tag ) 364 + __field( unsigned char, cmd ) 365 + __field( unsigned char, feature ) 366 + __field( unsigned char, hob_nsect ) 367 + __field( unsigned char, proto ) 368 + ), 369 + 370 + TP_fast_assign( 371 + __entry->ata_port = ap->print_id; 372 + __entry->tag = tag; 373 + __entry->proto = tf->protocol; 374 + __entry->cmd = tf->command; 375 + __entry->feature = tf->feature; 376 + __entry->hob_nsect = tf->hob_nsect; 377 + ), 378 + 379 + TP_printk("ata_port=%u tag=%d proto=%s cmd=%s%s", 380 + __entry->ata_port, __entry->tag, 381 + show_protocol_name(__entry->proto), 382 + show_opcode_name(__entry->cmd), 383 + __parse_subcmd(__entry->cmd, __entry->feature, __entry->hob_nsect)) 384 + ); 385 + 386 + DEFINE_EVENT(ata_exec_command_template, ata_exec_command, 387 + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag), 388 + TP_ARGS(ap, tf, tag)); 389 + 390 + DEFINE_EVENT(ata_exec_command_template, ata_bmdma_setup, 391 + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag), 392 + TP_ARGS(ap, tf, tag)); 393 + 394 + DEFINE_EVENT(ata_exec_command_template, ata_bmdma_start, 395 + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag), 396 + TP_ARGS(ap, tf, tag)); 397 + 398 + DEFINE_EVENT(ata_exec_command_template, ata_bmdma_stop, 399 + TP_PROTO(struct ata_port *ap, const struct ata_taskfile *tf, unsigned int tag), 400 + TP_ARGS(ap, tf, tag)); 401 + 402 + TRACE_EVENT(ata_bmdma_status, 403 + 404 + TP_PROTO(struct ata_port *ap, unsigned int host_stat), 405 + 406 + TP_ARGS(ap, host_stat), 407 + 408 + TP_STRUCT__entry( 409 + __field( unsigned int, ata_port ) 410 + __field( unsigned int, tag ) 411 + __field( unsigned char, host_stat ) 412 + ), 413 + 414 + TP_fast_assign( 415 + __entry->ata_port = ap->print_id; 416 + __entry->host_stat = host_stat; 417 + ), 418 + 419 + TP_printk("ata_port=%u host_stat=%s", 420 + __entry->ata_port, 421 + __parse_host_stat(__entry->host_stat)) 422 + ); 304 423 305 424 TRACE_EVENT(ata_eh_link_autopsy, 306 425