netatalk: lantest_io_monitor.c File Reference

netatalk 4.5.0
Free and Open Source Apple Filing Protocol (AFP) Server
Loading...
Searching...
No Matches
lantest_io_monitor.c File Reference

Linux I/O monitoring for Netatalk performance testing. More...

`#include <sys/types.h>`
`#include <stdint.h>`
`#include "lantest_io_monitor.h"`

## Functions
int32_t | check_proc_io_availability (void)
pid_t | find_process_pid (const char *process_name, const char *username, int32_t filter_by_cmdline)
void | capture_io_values (int32_t is_start)
uint64_t | iodiff_io (pid_t pid, int32_t is_write)
void | init_io_monitoring (const char *username)

## Variables
bool | io_monitoring_enabled = false
pid_t | afpd_pid = 0
pid_t | cnid_dbd_pid = 0
uint64_t | afpd_start_reads = 0
uint64_t | afpd_start_writes = 0
uint64_t | cnid_start_reads = 0
uint64_t | cnid_start_writes = 0
uint64_t | afpd_end_reads = 0
uint64_t | afpd_end_writes = 0
uint64_t | cnid_end_reads = 0
uint64_t | cnid_end_writes = 0

## Detailed Description

Linux I/O monitoring for Netatalk performance testing.

Monitors system call I/O statistics for afpd and cnid_dbd processes during tests. Uses /proc_io filesystem (a secondary mount of proc) to track read/write syscalls. Automatically discovers target processes by name and user, handling both privilege-dropped processes (afpd) and root processes with user arguments (cnid_dbd). Provides before/after test IO metrics to measure actual filesystem activity during AFP operations.

## Function Documentation

## ◆ capture_io_values()

void capture_io_values | ( | int32_t | is_start | ) |

## ◆ check_proc_io_availability()

int32_t check_proc_io_availability | ( | void |  | ) |

## ◆ find_process_pid()

pid_t find_process_pid | ( | const char * | process_name,
|  | const char * | username,
|  | int32_t | filter_by_cmdline )

## ◆ init_io_monitoring()

void init_io_monitoring | ( | const char * | username | ) |

## ◆ iodiff_io()

uint64_t iodiff_io | ( | pid_t | pid,
|  | int32_t | is_write )

## Variable Documentation

## ◆ afpd_end_reads

uint64_t afpd_end_reads = 0

## ◆ afpd_end_writes

uint64_t afpd_end_writes = 0

## ◆ afpd_pid

pid_t afpd_pid = 0

## ◆ afpd_start_reads

uint64_t afpd_start_reads = 0

## ◆ afpd_start_writes

uint64_t afpd_start_writes = 0

## ◆ cnid_dbd_pid

pid_t cnid_dbd_pid = 0

## ◆ cnid_end_reads

uint64_t cnid_end_reads = 0

## ◆ cnid_end_writes

uint64_t cnid_end_writes = 0

## ◆ cnid_start_reads

uint64_t cnid_start_reads = 0

## ◆ cnid_start_writes

uint64_t cnid_start_writes = 0

## ◆ io_monitoring_enabled

bool io_monitoring_enabled = false