r/linuxdev • u/[deleted] • Nov 25 '14
r/linuxdev • u/JMagnum86 • Sep 24 '14
jsoncpp issue
I'm having a difficult time including jsoncpp into my own project. I built the amalgamated source (which completed successfully) but the instructions are a little confusing on how to actually structure the files in my own project. Sorry but I'm a little new to this open source stuff and the instructions are bit too high level for me. Here is what my folder structure looks like:
/myProject/mySourcefile.cpp
/myPorject/mySourcefile.h
/myProject/jsoncpp.cpp
/myProject/json/json.hI have included: #include <json/json.h> in mySourcefile.h
I am compiling with g++ -o server mySourcefile.cpp jsoncpp.cpp
I get an error: fatal error: json/assertions.h: No such file or directory
I'm pretty sure the files aren't set up correctly or maybe I didn't install a library correctly. I've done quite a bit of searching but haven't been able to find anything. This is very confusing for me. Help would be appreciated.
r/linuxdev • u/[deleted] • Jul 22 '14
How do you reliably test for performance?
I'm writing some C programs and I want to know if any optimisations I'm potentially adding to my code have any effect on CPU or memory usage at all. What tools do you recommend to reliably test this?
r/linuxdev • u/[deleted] • Jul 08 '14
Devices for Driver Practice
Hi. I've been continuing my study of OS concepts and am still struggling a bit when it comes to drivers and the hardware-software interface. So I thought I'd benefit from diving into drivers. I'm, however, unsure what devices I can use for practice. As I'm not particularly experienced with hardware and electronics, I'd like a configuration that I can cheaply and quickly setup (and perhaps connect directly to my computer). I am however unsure of what devices to look at.
Thanks
r/linuxdev • u/adamfowl • Apr 29 '14
Building a filesystem using VFS: How to implement creation of file via "echo ... > newfile"
So I've been toying with building a lightweight filesystem using linux VFS and kernel 3.10.34. So far I've gotten mkdir and touch to work by implementing the corresponding inode operations(mkdir and create). However I can't seem to get "echo ... > newfile" to work(by "work" I mean I want the new file to have whatever was echoed to it as it's contents). I tried to analyze the system calls used by my ext3 filesystem on my arch machine via strace to see what is going on under the surface but it didn't really help. If someone could explain to me what is going on when creating a new file via IO redirection(including what VFS ops are called) it would be greatly appreciated!
Oh also as of now I can create a new file via "echo .. > newfile" but the file will be empty in stead of containing the stuff echoed to it.
r/linuxdev • u/JRepin • Dec 12 '13
Qt 5.2 brings Android and iOS support, heavy graphics and desktop improvements
r/linuxdev • u/[deleted] • Dec 11 '13
What are your thoughts on this idea?
I'm thinking about learning some C++ and contributing a feature that I think Linux could use to the Dolphin file manager. For me, transferring files from home folders to non-home folders is a pain with the CLI (especially when working on themes). So I'm thinking that (if the KDE devs allow it) I can put some code into Dolphin to move files to non-home folders using the file manager. The root password will be provided via popup prompt. What are your guys' thoughts on this idea?
r/linuxdev • u/jecxjo • Nov 12 '13
[Question] Additional ways to debug a hanging process (C++)
EDIT So further investigation into getting GDB working and recompiling a lot of code I found that if I start up the code under gdb and set a breakpoint at main I'm able to step through code and see each line. If I set another breakpoint I'm able to stop and read further lines. In both of these situations the full stack is available and I can see all my threads.
So the problem now is getting an attached process. I can attach, set a breakpoint and step through only that thread. info thread returns nothing. This also only works when the code is not hung up and actually hits the breakpoint. When the code is hanging I'm not sure what info I can get. The one time I was able to get a duplication the thread was in /lib/libc.so and backtrace showed (the addresses are made up here, I'll have to dig around my notes to see if I even have the real ones)
(gdb) bt
#0 0x4038b8fc in ?? () from /lib/libc.so.6
(gdb)So my plan right now is to figure out a way to pipe strace output from the start to a file (not sure how to roll it over so I don't run out of space). And hopefully figure out a good way to get GDB to present info on an active process.
I have some code out in the field that is locking up after a few months of runtime. I'm unable to duplicate it in the office so I'm trying to script up detection of the failure and then have it generate as much information about what the current status is to hopefully bring the issue to light.
Background:
The code is written in C++ using the ADAPTIVE Communications Environment library. Its running on an ARM board, 2.6.27 kernel. The code is mainly two large state machines. TCP comms to read and configure a network of devices in one language and then convert that to a different serial port language on the back end. All together its about 30k lines of code.
Looking at the process info via ps the CPU time looks normal, no huge memory spikes, no zombie processes. Everything "looks" good except for the fact that the application stops responding. With the stop large state machines I have a feeling that there is a TCP request that does not time out, or a mutex that is locked and never unlocked...some sort of race condition. But spending hours and hours reading over the code I just can't seem to make any headway.
In the two times I think I was able to duplicate the issue gdb was unable to do a backtrace when attaching to the process claiming the stack was unavailable (I built with the -g options, etc so it should have debug info) and strace says the last call was locking a futex, see example number 3 here. I've tried adding function call tracing output but flushing printf when a lockup occurs has never been very accurate since this is a multi-thread application.
Question:
So I've tried gdb with no luck, strace is no help, printf is a no go. Since the code doesn't crash, but rather locks most likely due to a race condition I'm not able to see where the code is currently at when everything stops. Both state machines (TCP Side, Serial Side) are both highly timing dependent and the issue takes months to surface, running in gdb from the start is a not an option. My question is, what other options are there for attempting to debug this issue? Even the most off the wall suggestions are helpful as I have been racking my brain for months trying to figure this one out with no luck. I will be scripting up a huge amount of things to try, store it off to some non-volatile memory for retrieval later when the customer is notified that a lock up has occured.
tl;dr I've tried gdb connecting to a process, strace, printf'ing function calls and still can not figure out a lockup situation in my code. I'm looking for any suggestions on other ways to identify where my code is at and why it locked up. The duplication period is months and only seen in the field so I'll have to script up as much as possible to gather any information.
r/linuxdev • u/linux_curious • Oct 05 '12
How can 2 LKMs provide the same interface to a common client LKM and yet avoid kernel symbol conflicts ? What are the different possible options ?
At a higher level want to know the different methods for LKMs /drivers to communicate with each other ?
r/linuxdev • u/linux_curious • Aug 09 '12
What is the diff b/n doing ioread32 and sending a mailbox command to my H/W
as in how come i don't need a cpu_to_<endian> conversion for the ioread32() but need it while sending a mailbox command embedding an IOCTL to my H/W /Firmware ? I think i have half an answer but i'd really like to get to know the nuts n bolts of this whole io mapping in memory pls ? Without too much of the abstraction fluff ... Thanks
r/linuxdev • u/[deleted] • Jul 02 '12
Controlling hardware with ioctls.
I'm a noob at low-level Linux programming.
I've been following this Linux journal post to help me interact with an ethernet driver. I'm writing an application that will set the link speed, duplex, flow control, etc. for an ethernet port. I'm using the ioctl() to interface with the device driver. My only question is which ETHTOOL subcommand should I use: ETHTOOL_SSET?
r/linuxdev • u/[deleted] • Apr 24 '12
An interesting project to emulate Linux under windows. (Like dosbox, not quemu or virtualbox)
r/linuxdev • u/91_pavan • Apr 05 '12
Building own custom linux kernel
One of my professors suggested me if i want to start with linux development , first thing is to try and build own custom linux kernel and compile it and see what happens . But the problem being i'm not able to find any tutorials which clearly specifies where i should start from ? I'm really looking forward to contributing to linux in some way or the other in the futute .So hope this will be the starting point. Help appreciated!
r/linuxdev • u/Salt_Syrup5039 • Sep 24 '26
A lightweight web generator for production-hardened systemd unit files (Linux Systemd Service Generator )
Hello all,
I put together a small client-side utility for scaffolding Linux systemd .service files:
Features implemented:
- Strict path checking (flags relative binary paths that trigger 203/EXEC errors).
- Sandboxing directives (NoNewPrivileges=true, PrivateTmp=true, ProtectSystem=full, ProtectHome=true).
- LimitNOFILE configuration and StandardOutput/journal routing.
- Templates for common daemons (Docker Compose, Python Gunicorn workers, Node.js standalone, Go binaries).
- One-liner bash snippet to write the unit file and reload the daemon non-interactively.
The tool runs 100% client-side with zero backend dependencies. If you notice any missing standard directives or edge cases that should be flagged, please let me know!
IF YOU LIKED MY WEBSITE AND FOUND IT HELPFUL THEN PLEASE DO UPVOTE THIS POST <3!
r/linuxdev • u/xmanotaur • Aug 16 '26
Trying to understand thread stack separation after diving into task_struct and CLONE_VM
reddit.comr/linuxdev • u/Radiant-Spinach4842 • Jul 05 '26
I built TuneD-Next to automatically integrate TuneD with GNOME/KDE power profiles + custom battery/gaming profiles (SWE Student Project).
Hey fellow Linux users! š
Iām a Software Engineering student/recent grad, and I recently decided to tackle a problem that always bothered me: getting TuneD to seamlessly sync with the native GNOME/KDE power sliders out of the box, without having to manually write mappings and configure tuned-ppd.
To earn some academic extension credits for my degree (and give something back to this awesome community), I created TuneD-Next.
š Project Link:https://gitlab.com/klock.mt/tuned-next
What it does:
Currently, if you want TuneD to replace power-profiles-daemon (PPD) and show up in your GUI quick settings, it requires some manual configuration. My package automates this entire pipeline safely.
When you install it, it provides:
Automatic GUI Integration: Safely masks the original PPD, activates tuned.service, and automatically configures tuned-ppd to map your desktop's power slider (Power Saver, Balanced, Performance) to custom TuneD profiles.
Custom Profiles Out of the Box: Includes new custom profiles like Ultra-Saver, Gaming-mode, Bat-Balanced, Ac-Performance, and Kernel-comp.
ZRAM Optimization: Configures ZRAM automatically via zram-generator (ZRAM size, zstd compression) for better compilation and gaming performance.
Safe Setup Script: A defensive Python setup script that handles the transitions and includes a rollback function if the daemon fails to start, ensuring your system never loses power management.
The Roadmap
I am planning to run extensive, data-driven benchmarks on my hardware soon to tweak and improve these custom profiles even further.
I need your feedback!
Since this is an academic project, I would absolutely love it if you guys could check out the code. I am completely open to suggestions, code reviews, and Pull Requests to improve the architecture or the profiles.
ā Also, if you find this useful or just want to support a junior developer, dropping a Star on the GitLab repository would mean the world to me (and it will definitely impress my professor for those extension points!).
Thank you for your time, and happy compiling! š§
r/linuxdev • u/swe129 • Feb 23 '26
Intel Hiring More Linux Developers - Including For GPU Drivers / Linux Gaming Stack
r/linuxdev • u/Confident-Ad-3817 • Feb 17 '26
How do I remove grub from UEFI
I installed proxmox and now I want to delete it. But because of GNU grub, I can't install Windows 11 from bootable usb
r/linuxdev • u/ParfaitEconomy • Jun 10 '23
I wanted to ask why would I download Linux
Hello,
So I'm new to this community (not new to Linux, been using Ubuntu and Fedora for quite some time). I was thinking of buying a new laptop in the near future, and I wanted to decide between a Mac and another Thinkpad (the laptop I have currently, and I really liked it), which brings me to my question.
Why would I get a Thinkpad and install Linux, vs getting a Mac which is Unix based to begin with along with having amazing battery life with it's M2 chip (Ignore price as a factor)?
I was looking back through my Linux journey and I've realized that Linux has had multiple problems for me, such as having issues with dual booting, issues with Microphone and Speakers, distros not fitting on screens,Linux and such.
I was also wondering, couldn't you do most of your stuff regarding linux dev in Macs? as well? I wanted to ask what about Linux can you not reproduce without a high amount of effort on macs.
(Also I wanted to ask whether, in terms of security, are macs inherently better than linux).
Thank you :)
r/linuxdev • u/lephuhai • Apr 24 '23
Introducing ManRepository: An Linux Manual page for Ubuntu/ Debian / Arch Linux,...
Hello everyone,
I often read Linux manuals pages online and I noticed some issues.
- Often they don't have the manuals of the software I use
- The formatting of the man pages not easily to read
So I decided to create new site to fix this issues and called it ManRepository.com.
It currently indexes all package information of Ubuntu, Debian, and Arch Linux. And displays all man page documents of each package. The man pages are formatted in HTML, making it easy to read them on any device because the website supports responsive design.
Website watch package updates in the repositories and quickly indexes any newly added manuals in the package.
I've already been using the site for a while, and I believe it will be just as helpful to you. Please feel free to try it out and share your feedback with me to help make this project even more useful.
Thank you so much.