So far, you have understood how to create and make use of sysfs for user space kernel interfacing purposes, but there is a key point that we have been ignoring. There is a "rule" regarding using sysfs files, which states that you must only read or write exactly one value! Think of this as the one-value-per-file rule.
So, as in the example where we used the "pressure" value, we merely return the current value of the pressure, nothing more. Thus, sysfs, unlike the other interfacing technologies, is not quite suited to those cases where you might want to return arbitrary long-winded information packets (say, the contents of the driver context structure) to the user space; in other words, it's not suited to pure "debugging" purposes.
The kernel documents and "rules" regarding the usage of sysfs can be found here: https://www.kernel.org/doc/html/latest/admin-guide/sysfs-rules.html#rules-on...