Saruman was the head of the Istari Order and Gandalf trusted him.
Gandalf, before Saruman revealed himself to him, believed that Saruman was still the head of their order and had no intentions of going against them.
Hobbits are, or were, no concern of his. Yet he is great among the Wise. He is the chief of my order and the head of the Council. His knowledge is deep, but his pride has grown with it, and he takes ill any meddling. The lore of the Elven-rings, great and small, is his province. He has long studied it, seeking the lost secrets of their making; but when the Rings were debated in the Council, all that he would reveal to us of his ring-lore told against my fears. So my doubt slept – but uneasily. Still I watched and I waited.
Fellowship of the Ring - Book One, Chapter II: The Shadow of the Past
Gandalf, at the beginning still has faith in Saruman and believes his councils, putting his trust and faith in him.
Saruman expected Gandalf to inform him of everything that went on and ensure Gandalf was aware of such.
“That may be so,” he said, “but the thought is late in coming to you. How long, I wonder, have you concealed from me, the head of the Council, a matter of greatest import?”
Fellowship of the Ring - Book Two, Chapter II: The Council of Elrond
However, Saruman knows he needs Gandalf on his side to truly be successful, this is because he knows that Olorin is deemed amongst the wise of the Maiar. When he reveals himself to Gandalf, he didn't expect Gandalf to escape from his capture on top of Orthanc. After Gandalf escapes he speeds as quickly as he can to warn Frodo and Elrond of Saruman's betrayal.
With regards to your follow up question, it is unlikely Saruman knew Frodo before the events of the Ring, as Saruman often talks down upon the Hobbits
What brings you now from your lurking-place in the Shire?
Fellowship of the Ring - Book Two, Chapter II: The Council of Elrond
Describing the Shire as a "lurking-place" seems to suggest Saruman disapproves of Gandalf's interaction with the Hobbit folk. This is further supported by Saruman's apparent lack of care for Hobbits.
I could only watch and wait. I might perhaps have consulted Saruman the White, but something always held me back.’
‘Who is he?’ asked Frodo. ‘I have never heard of him before.’
‘Maybe not,’ answered Gandalf. ‘Hobbits are, or were, no concern of his...
Fellowship of the Ring - Book One, Chapter II: The Shadow of the Past
The above seems to, however, suggest that Saruman might have begun to take a care for Hobbits, and towards the end (likely through Bill Ferny), gained knowledge of Frodo and learnt who he was, before the Scouring of the Shire.