Preheat the oven to 375 degrees F (190 degrees C).
Heat 1/2 tablespoon oil an oven-proof pan large enough to fit the tenderloin over medium-high heat. Add onion and garlic; saute until just starting to brown, about 5 minutes. Remove from heat and stir in parsley and mustard. Transfer to a bowl and season with pepper.
Place tenderloin on a flat work surface. Slice horizontally through the middle, being careful not to cut all the way through to the other side. Open the 2 sides and spread them out like an open book. Place pork between 2 sheets of heavy plastic on a solid, level surface. Firmly pound with the smooth side of a meat mallet to a 1/2-inch thickness. Trim any extra pieces so the tenderloin is rectangular.
Chop the pork trimmings finely and add to the onion mixture. Spread onion mixture onto pork. Lay ham slices over it and sprinkle Gruyere cheese on top. Roll tenderloin up along the long side. Tie with cotton kitchen string. Season with salt and pepper.
Heat remaining oil in the same pan over medium-high heat. Sear tenderloin in the hot oil until browned, 3 to 5 minutes per side.
Transfer pan to the preheated oven and bake until an instant-read thermometer inserted into the center of the tenderloin reads 145 degrees F (71 degrees C), 25 to 30 minutes. Let rest for 5 minutes before slicing.