Why is my cement cracking near the wall?
That crack looks too uniform (straight) to be a structural crack.
The concrete under the masonry wall is probably the top of the foundation wall. I suspect the slab was poured up against the foundation wall and the edges of the slab have spalled off.
If you notice there’s a control joint running perpendicular to the masonry wall too. This helps keep the slab from having random cracks.
Yes, the joints are a little rough. You can grind down the high spots and fill in the low spots with a concrete filler or sealant if you’re concerned about expansion. (Concrete continues shrinking as it ages, unless you live where the sun could heat the slab and make it expand.)