Skip to content

Instantly share code, notes, and snippets.

@RLovelett
Last active February 26, 2023 09:40
Show Gist options
  • Save RLovelett/296715e89d50ee464d0614eab02394f9 to your computer and use it in GitHub Desktop.
Save RLovelett/296715e89d50ee464d0614eab02394f9 to your computer and use it in GitHub Desktop.
FT232H user space GPIO device - https://stackoverflow.com/q/60781594/247730

Setting up ftrace

$ sudo su - root
$ cd /sys/kernel/debug/tracing
$ cat available_tracers
hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop
$ cat available_filter_functions | grep ftdi_sio | cut -d' ' -f1 | tr '\n' ' ' > set_ftrace_filter
$ cat set_ftrace_filter
get_serial_info [ftdi_sio]
ftdi_sio_probe [ftdi_sio]
ftdi_USB_UIRT_setup [ftdi_sio]
ftdi_HE_TIRA1_setup [ftdi_sio]
ftdi_stmclite_probe [ftdi_sio]
ftdi_jtag_probe [ftdi_sio]
ftdi_NDI_device_setup [ftdi_sio]
update_mctrl [ftdi_sio]
ftdi_tiocmset [ftdi_sio]
ftdi_8u2232c_probe [ftdi_sio]
ftdi_prepare_write_buffer [ftdi_sio]
ftdi_break_ctl [ftdi_sio]
write_latency_timer [ftdi_sio]
ftdi_get_modem_status [ftdi_sio]
ftdi_tiocmget [ftdi_sio]
ftdi_tx_empty [ftdi_sio]
_read_latency_timer [ftdi_sio]
ftdi_ioctl [ftdi_sio]
ftdi_set_bitmode [ftdi_sio]
ftdi_read_cbus_pins [ftdi_sio]
ftdi_sio_port_remove [ftdi_sio]
latency_timer_store [ftdi_sio]
event_char_store [ftdi_sio]
ftdi_gpio_set_multiple [ftdi_sio]
ftdi_gpio_get_multiple [ftdi_sio]
ftdi_gpio_set [ftdi_sio]
ftdi_gpio_get [ftdi_sio]
ftdi_gpio_direction_output [ftdi_sio]
ftdi_gpio_direction_input [ftdi_sio]
ftdi_gpio_direction_get [ftdi_sio]
ftdi_gpio_request [ftdi_sio]
ftdi_read_eeprom.part.0 [ftdi_sio]
ftdi_dtr_rts [ftdi_sio]
latency_timer_show [ftdi_sio]
ftdi_232bm_baud_base_to_divisor.constprop.0 [ftdi_sio]
ftdi_232am_baud_base_to_divisor.constprop.0 [ftdi_sio]
get_ftdi_divisor [ftdi_sio]
change_speed [ftdi_sio]
ftdi_set_termios [ftdi_sio]
ftdi_open [ftdi_sio]
set_serial_info [ftdi_sio]
ftdi_sio_port_probe [ftdi_sio]
ftdi_process_read_urb [ftdi_sio]
$ echo function > current_tracer
$ cat current_tracer
function
$ cat trace
# tracer: function
#
# entries-in-buffer/entries-written: 410159/109278334   #P:8
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
     kworker/2:8-219   [002] ....  1642.148727: ftdi_sio_probe <-usb_serial_probe
     kworker/2:8-219   [002] ....  1642.148752: ftdi_sio_port_probe <-usb_serial_device_probe
     kworker/2:8-219   [002] ....  1642.148754: _read_latency_timer <-ftdi_sio_port_probe.cold
     kworker/2:8-219   [002] ....  1642.148775: write_latency_timer <-ftdi_sio_port_probe.cold
     kworker/7:2-359   [007] ....  1838.316063: ftdi_sio_port_remove <-usb_serial_device_remove

Note

[ 198.160119] usb 1-2: new high-speed USB device number 6 using xhci_hcd
[ 198.188823] usb 1-2: New USB device found, idVendor=0403, idProduct=6014, bcdDevice= 9.00
[ 198.188825] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 198.188827] usb 1-2: Product: USB <-> Serial Converter
[ 198.188828] usb 1-2: Manufacturer: FTDI
[ 198.188829] usb 1-2: SerialNumber: FT553LEZ
[ 198.193719] ftdi_sio 1-2:1.0: FTDI USB Serial Device converter detected
[ 198.193745] usb 1-2: Detected FT232H
[ 198.193883] usb 1-2: FTDI USB Serial Device converter now attached to ttyUSB0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment