Question: After I successfully upgraded OpenBSD, I wanted to upgrade my sources. I want to know, is it safer to delete `/usr/src` and then extract `src.tar.gz`, or is it better to preserve the already existing `/usr/src` and then extract `src.tar.gz`? Will there be any repercussions caused by deleting `/usr/src`, or can I simply replace it?

Answer: 
So one of the big things about learning to Unix is reading the bloody man page:

I'm not just being a get off my lawn grumpy old man, there REALLY IS valuable information in there. In this case:

> 
> DESCRIPTION
> sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is
> required for sysctl support in Linux. You can use sysctl to both read and write sysctl data.
> 
> 
> 

So we can:

```
$sudo sysctl -a | grep kernel.perf_event_max_sample_rate
kernel.perf_event_max_sample_rate = 50000
sysctl: reading key "net.ipv6.conf.all.stable_secret"
sysctl: reading key "net.ipv6.conf.default.stable_secret"
sysctl: reading key "net.ipv6.conf.enp3s0.stable_secret"
sysctl: reading key "net.ipv6.conf.lo.stable_secret"
sysctl: reading key "net.ipv6.conf.wlp1s0.stable_secret"

```

By reading the manpage we learn that -a is "display all values currently available", but we also can see:

> 
> SYNOPSIS
> 
> 
> 

> 
> 
> ```
>   sysctl [options] [variable[=value]] [...]
> 
> ```
> 
> 

> 
> 
> ```
>   sysctl -p [file or regexp] [...]
> 
> ```
> 
> 

which means we can shorten the above command to:

```
$ sudo sysctl kernel.perf_event_max_sample_rate
kernel.perf_event_max_sample_rate = 50000    

```

Or we can:

```
$ more /proc/sys/kernel/perf_event_max_sample_rate 
50000

```

So, TL;DR:

1. Yes, you can write a script to log this variable every few minutes, but if it's going to show up in the logs when it changes, why would you?
2. It would probably be more efficient to read the value right out of /proc/sys/kernel/perf\_event\_max\_sample\_rate than to use sysctl, and it would be more efficient to ask for the specific value from sysctl than to use grep.
If you read the manpage of systctl you also see that systctl is just a mirror of */process/sys*.
So you don't need any command to change the systctl value.
Just run 

```
echo $value > /proc/sys/$sysctl_setting

```

Just beware to replace \*.\*with */* in this case.

Loop this in a while loop like this:

```
sleep_time=10m
while true ; do 
         echo $value > /proc/sys/$sysctl_setting
         sleep $sleep_time
done

```